Allow all users to delete their packages

This commit is contained in:
rubenwardy
2020-09-16 18:05:37 +01:00
parent 92fb54556a
commit 258a23cd9a
4 changed files with 34 additions and 12 deletions

View File

@@ -813,7 +813,7 @@ class Package(db.Model):
return isOwner or user.rank.atLeast(UserRank.MODERATOR)
elif perm == Permission.UNAPPROVE_PACKAGE or perm == Permission.DELETE_PACKAGE:
return user.rank.atLeast(UserRank.EDITOR)
return user.rank.atLeast(UserRank.MEMBER if isOwner else UserRank.EDITOR)
elif perm == Permission.CHANGE_RELEASE_URL:
return user.rank.atLeast(UserRank.MODERATOR)