Fix editors not being able to approve releases

This commit is contained in:
rubenwardy 2021-04-28 23:18:16 +01:00
parent c0719fdeaa
commit a33a4bd894
1 changed files with 3 additions and 2 deletions

View File

@ -913,8 +913,9 @@ class PackageRelease(db.Model):
return count > 0
elif perm == Permission.APPROVE_RELEASE:
return isMaintainer and user.rank.atLeast(
UserRank.MEMBER if self.approved else UserRank.NEW_MEMBER)
return user.rank.atLeast(UserRank.EDITOR) or \
(isMaintainer and user.rank.atLeast(
UserRank.MEMBER if self.approved else UserRank.NEW_MEMBER))
else:
raise Exception("Permission {} is not related to releases".format(perm.name))