Allow all members to approve own releases

This commit is contained in:
rubenwardy 2020-04-21 17:06:27 +01:00
parent 24090235d1
commit a8374ec779

@ -659,7 +659,7 @@ class Package(db.Model):
if perm == Permission.MAKE_RELEASE or perm == Permission.ADD_SCREENSHOTS: if perm == Permission.MAKE_RELEASE or perm == Permission.ADD_SCREENSHOTS:
return isOwner or user.rank.atLeast(UserRank.EDITOR) return isOwner or user.rank.atLeast(UserRank.EDITOR)
if perm == Permission.EDIT_PACKAGE or perm == Permission.APPROVE_CHANGES: if perm == Permission.EDIT_PACKAGE or perm == Permission.APPROVE_CHANGES or perm == Permission.APPROVE_RELEASE:
if isOwner: if isOwner:
return user.rank.atLeast(UserRank.MEMBER if self.approved else UserRank.NEW_MEMBER) return user.rank.atLeast(UserRank.MEMBER if self.approved else UserRank.NEW_MEMBER)
else: else:
@ -673,7 +673,7 @@ class Package(db.Model):
elif perm == Permission.APPROVE_NEW or perm == Permission.CHANGE_AUTHOR: elif perm == Permission.APPROVE_NEW or perm == Permission.CHANGE_AUTHOR:
return user.rank.atLeast(UserRank.EDITOR) return user.rank.atLeast(UserRank.EDITOR)
elif perm == Permission.APPROVE_RELEASE or perm == Permission.APPROVE_SCREENSHOT: elif perm == Permission.APPROVE_SCREENSHOT:
return user.rank.atLeast(UserRank.TRUSTED_MEMBER if isOwner else UserRank.EDITOR) return user.rank.atLeast(UserRank.TRUSTED_MEMBER if isOwner else UserRank.EDITOR)
# Moderators can delete packages # Moderators can delete packages