]> git.lizzy.rs Git - cheatdb.git/commitdiff
Remove admin from being able to edit any comment
authorrubenwardy <rw@rubenwardy.com>
Sat, 11 Jul 2020 03:26:50 +0000 (04:26 +0100)
committerrubenwardy <rw@rubenwardy.com>
Sat, 11 Jul 2020 03:26:50 +0000 (04:26 +0100)
app/flatpages/help/ranks_permissions.md
app/models.py

index 972c570e7d86fb33961a11ec74bb72e18cf0b35a..94af9a3e6c12c18b384f4a9f050087ad5a284737 100644 (file)
@@ -206,7 +206,7 @@ title: Ranks and Permissions
                </tr>
                <tr>
                        <td>Edit Comments</td>
-                       <th></th> <!-- new -->
+                       <th></th> <!-- new -->
                        <th></th>
                        <th>✓</th> <!-- member -->
                        <th></th>
@@ -217,7 +217,7 @@ title: Ranks and Permissions
                        <th>✓</th> <!-- moderator -->
                        <th></th>
                        <th>✓</th> <!-- admin -->
-                       <th></th>
+                       <th></th>
                </tr>
                <tr>
                        <td>Set Email</td>
index 4ab44126584100649331ed008a064ba1c44326ea..58cf99201978476a325a8680875bc0cdef505eb5 100644 (file)
@@ -1148,8 +1148,7 @@ class ThreadReply(db.Model):
                        raise Exception("Unknown permission given to ThreadReply.checkPerm()")
 
                if perm == Permission.EDIT_REPLY:
-                       return (user == self.author and user.rank.atLeast(UserRank.MEMBER) and not self.thread.locked) or \
-                                       user.rank.atLeast(UserRank.ADMIN)
+                       return user == self.author and user.rank.atLeast(UserRank.MEMBER) and not self.thread.locked
 
                elif perm == Permission.DELETE_REPLY:
                        return user.rank.atLeast(UserRank.MODERATOR) and self.thread.replies[0] != self