Allow editors to unapprove and delete packages
This commit is contained in:
parent
1daf59b7db
commit
ee6de95a52
|
@ -69,6 +69,21 @@ title: Ranks and Permissions
|
||||||
<th>✓</th> <!-- admin -->
|
<th>✓</th> <!-- admin -->
|
||||||
<th>✓</th>
|
<th>✓</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Delete Package</td>
|
||||||
|
<th></th> <!-- new -->
|
||||||
|
<th></th>
|
||||||
|
<th></th> <!-- member -->
|
||||||
|
<th></th>
|
||||||
|
<th></th> <!-- trusted member -->
|
||||||
|
<th></th>
|
||||||
|
<th>✓</th> <!-- editor -->
|
||||||
|
<th>✓</th>
|
||||||
|
<th>✓</th> <!-- moderator -->
|
||||||
|
<th>✓</th>
|
||||||
|
<th>✓</th> <!-- admin -->
|
||||||
|
<th>✓</th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Edit Package</td>
|
<td>Edit Package</td>
|
||||||
<th></th> <!-- new -->
|
<th></th> <!-- new -->
|
||||||
|
|
|
@ -708,9 +708,10 @@ class Package(db.Model):
|
||||||
elif perm == Permission.EDIT_MAINTAINERS:
|
elif perm == Permission.EDIT_MAINTAINERS:
|
||||||
return isOwner or user.rank.atLeast(UserRank.MODERATOR)
|
return isOwner or user.rank.atLeast(UserRank.MODERATOR)
|
||||||
|
|
||||||
# Moderators can delete packages
|
elif perm == Permission.UNAPPROVE_PACKAGE or perm == Permission.DELETE_PACKAGE:
|
||||||
elif perm == Permission.DELETE_PACKAGE or perm == Permission.UNAPPROVE_PACKAGE \
|
return user.rank.atLeast(UserRank.EDITOR)
|
||||||
or perm == Permission.CHANGE_RELEASE_URL:
|
|
||||||
|
elif perm == Permission.CHANGE_RELEASE_URL:
|
||||||
return user.rank.atLeast(UserRank.MODERATOR)
|
return user.rank.atLeast(UserRank.MODERATOR)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue