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>
|
||||
</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>
|
||||
<td>Edit Package</td>
|
||||
<th></th> <!-- new -->
|
||||
|
@ -708,9 +708,10 @@ class Package(db.Model):
|
||||
elif perm == Permission.EDIT_MAINTAINERS:
|
||||
return isOwner or user.rank.atLeast(UserRank.MODERATOR)
|
||||
|
||||
# Moderators can delete packages
|
||||
elif perm == Permission.DELETE_PACKAGE or perm == Permission.UNAPPROVE_PACKAGE \
|
||||
or perm == Permission.CHANGE_RELEASE_URL:
|
||||
elif perm == Permission.UNAPPROVE_PACKAGE or perm == Permission.DELETE_PACKAGE:
|
||||
return user.rank.atLeast(UserRank.EDITOR)
|
||||
|
||||
elif perm == Permission.CHANGE_RELEASE_URL:
|
||||
return user.rank.atLeast(UserRank.MODERATOR)
|
||||
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user