* **New Members** - mostly untrusted, cannot change package meta data or publish releases without approval.
* **Members** - Trusted to change the meta data of their own packages', but cannot publish releases.
+* **Trusted Members** - Same as above, but can approve their own releases and packages.
* **Editors** - Trusted to change the meta data of any package, and also make and publish releases.
* **Moderators** - Same as above, but can manage users.
* **Admins** - Full access.
<th>Rank</th>
<th colspan=2>New Member</th>
<th colspan=2>Member</th>
+ <th colspan=2>Trusted Member</th>
<th colspan=2>Editor</th>
<th colspan=2>Moderator</th>
<th colspan=2>Admin</th>
<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> <!-- member -->
<th></th>
+ <th>✓</th> <!-- trusted member -->
+ <th></th>
<th>✓</th> <!-- editor -->
<th>✓</th>
<th>✓</th> <!-- moderator -->
<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> <!-- member -->
<th></th>
+ <th>✓</th> <!-- trusted member -->
+ <th></th>
<th>✓</th> <!-- editor -->
<th>✓</th>
<th>✓</th> <!-- moderator -->
<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> <!-- member -->
<th></th>
+ <th>✓</th> <!-- trusted member -->
+ <th></th>
<th>✓</th> <!-- editor -->
<th>✓</th>
<th>✓</th> <!-- moderator -->
<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> <!-- member -->
<th></th>
+ <th>✓</th> <!-- trusted member -->
+ <th></th>
<th>✓</th> <!-- editor -->
<th>✓</th>
<th>✓</th> <!-- moderator -->
<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> <!-- member -->
<th></th>
+ <th></th> <!-- trusted member -->
+ <th></th>
<th></th> <!-- editor -->
<th></th>
<th></th> <!-- moderator -->
<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> <!-- member -->
<th></th>
+ <th></th> <!-- trusted member -->
+ <th></th>
<th></th> <!-- editor -->
<th></th>
<th>✓<sup>3</sup></th> <!-- moderator -->
class UserRank(enum.Enum):
- BANNED = 0
- NOT_JOINED = 1
- NEW_MEMBER = 2
- MEMBER = 3
- EDITOR = 4
- MODERATOR = 5
- ADMIN = 6
+ BANNED = 0
+ NOT_JOINED = 1
+ NEW_MEMBER = 2
+ MEMBER = 3
+ TRUSTED_MEMBER = 4
+ EDITOR = 5
+ MODERATOR = 6
+ ADMIN = 7
def atLeast(self, min):
return self.value >= min.value
else:
return user.rank.atLeast(UserRank.EDITOR)
- # Editors can change authors, approve new packages, and approve releases
- elif perm == Permission.CHANGE_AUTHOR or perm == Permission.APPROVE_NEW \
- or perm == Permission.APPROVE_RELEASE or perm == Permission.APPROVE_SCREENSHOT:
+ # Editors can change authors
+ elif perm == Permission.CHANGE_AUTHOR:
return user.rank.atLeast(UserRank.EDITOR)
+ elif perm == Permission.APPROVE_NEW or perm == Permission.APPROVE_RELEASE \
+ or perm == Permission.APPROVE_SCREENSHOT:
+ return user.rank.atLeast(UserRank.TRUSTED_MEMBER if isOwner else UserRank.EDITOR)
+
# Moderators can delete packages
elif perm == Permission.DELETE_PACKAGE or perm == Permission.CHANGE_RELEASE_URL:
return user.rank.atLeast(UserRank.MODERATOR)