Browse Source

Allow admins to edit topics by the "generic user"

This will allow admins to edit topics posted automatically by the
scheduling system.
merge-requests/86/head
Deimos 5 years ago
parent
commit
63f6ea6069
  1. 7
      tildes/tildes/models/topic/topic.py

7
tildes/tildes/models/topic/topic.py

@ -307,10 +307,15 @@ class Topic(DatabaseModel):
acl.append((Allow, Authenticated, "comment"))
# edit:
# - only text topics can be edited, only by the author
# - only text topics can be edited
# - authors can edit their own topics
# - admins can edit topics belonging to the generic/automatic user
if self.is_text_type:
acl.append((Allow, self.user_id, "edit"))
if self.user_id == -1:
acl.append((Allow, "admin", "edit"))
# delete:
# - only the author can delete
acl.append((Allow, self.user_id, "delete"))

Loading…
Cancel
Save