mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 14:32:25 +01:00
Allow new members to edit their packages if it hasn't been approved yet
This commit is contained in:
parent
65fdba5882
commit
e85298d890
@ -401,7 +401,10 @@ class Package(db.Model):
|
|||||||
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:
|
||||||
return user.rank.atLeast(UserRank.MEMBER if isOwner else UserRank.EDITOR)
|
if isOwner:
|
||||||
|
return user.rank.atLeast(UserRank.MEMBER if self.approved else UserRank.NEW_MEMBER)
|
||||||
|
else:
|
||||||
|
return user.rank.atLeast(UserRank.EDITOR)
|
||||||
|
|
||||||
# Editors can change authors, approve new packages, and approve releases
|
# Editors can change authors, approve new packages, and approve releases
|
||||||
elif perm == Permission.CHANGE_AUTHOR or perm == Permission.APPROVE_NEW \
|
elif perm == Permission.CHANGE_AUTHOR or perm == Permission.APPROVE_NEW \
|
||||||
|
Loading…
Reference in New Issue
Block a user