aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/flatpages/help/ranks_permissions.md15
-rw-r--r--app/models.py7
2 files changed, 19 insertions, 3 deletions
diff --git a/app/flatpages/help/ranks_permissions.md b/app/flatpages/help/ranks_permissions.md
index 93a337c..5a2d592 100644
--- a/app/flatpages/help/ranks_permissions.md
+++ b/app/flatpages/help/ranks_permissions.md
@@ -70,6 +70,21 @@ title: Ranks and Permissions
<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 -->
<th></th>
diff --git a/app/models.py b/app/models.py
index cda5238..2b12562 100644
--- a/app/models.py
+++ b/app/models.py
@@ -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: