mirror of
https://github.com/minetest/contentdb.git
synced 2025-03-23 02:32:28 +01:00
Prevent trusted users from approving their own packages
This commit is contained in:
@ -34,6 +34,8 @@ title: Ranks and Permissions
|
|||||||
<th>N</th>
|
<th>N</th>
|
||||||
<th>Y</th>
|
<th>Y</th>
|
||||||
<th>N</th>
|
<th>N</th>
|
||||||
|
<th>Y</th>
|
||||||
|
<th>N</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -58,7 +60,7 @@ title: Ranks and Permissions
|
|||||||
<th></th>
|
<th></th>
|
||||||
<th></th> <!-- member -->
|
<th></th> <!-- member -->
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>✓</th> <!-- trusted member -->
|
<th></th> <!-- trusted member -->
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>✓</th> <!-- editor -->
|
<th>✓</th> <!-- editor -->
|
||||||
<th>✓</th>
|
<th>✓</th>
|
||||||
@ -101,7 +103,7 @@ title: Ranks and Permissions
|
|||||||
<td>Approve Screenshot</td>
|
<td>Approve Screenshot</td>
|
||||||
<th></th> <!-- new -->
|
<th></th> <!-- new -->
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>✓</th> <!-- member -->
|
<th></th> <!-- member -->
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>✓</th> <!-- trusted member -->
|
<th>✓</th> <!-- trusted member -->
|
||||||
<th></th>
|
<th></th>
|
||||||
@ -187,6 +189,21 @@ title: Ranks and Permissions
|
|||||||
<th>✓</th> <!-- admin -->
|
<th>✓</th> <!-- admin -->
|
||||||
<th>✓</th>
|
<th>✓</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>See Private Thread</td>
|
||||||
|
<th>✓</th> <!-- new -->
|
||||||
|
<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> <!-- admin -->
|
||||||
|
<th>✓</th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Set Email</td>
|
<td>Set Email</td>
|
||||||
<th>✓</th> <!-- new -->
|
<th>✓</th> <!-- new -->
|
||||||
|
@ -489,12 +489,11 @@ class Package(db.Model):
|
|||||||
else:
|
else:
|
||||||
return user.rank.atLeast(UserRank.EDITOR)
|
return user.rank.atLeast(UserRank.EDITOR)
|
||||||
|
|
||||||
# Editors can change authors
|
# Editors can change authors and approve new packages
|
||||||
elif 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_NEW or perm == Permission.APPROVE_RELEASE \
|
elif perm == Permission.APPROVE_RELEASE or perm == Permission.APPROVE_SCREENSHOT:
|
||||||
or 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
|
||||||
|
Reference in New Issue
Block a user