Show moderation options based on privileges
Corresponding BE issue: pleroma!3676 (closed)
We had moderators and admins who each were able to do certain things. Now we allow for much more fine grained settings of what someone can do. This needs to be reflected in the FE.
E.g. When you have the Moderator-role, you'll see the option to delete posts. With these changes you should only be able to see that option when you are privileged to delete other users posts, regardless of role. This is one example, but is true for everything moderator related. Things I can think of
- Being able to handle reports
- At time of writing not yet merged: !1322 (merged)
- We possibly don't need extra logic for this. BE shouldn't send these notifications when they aren't privileged in the first place.
- Announcements
- At time of writing not yet merged: !1466 (merged)
- Deleting posts
- Seeing deactivated users
- The moderation drop down on a profile
- Others?
The privileges are part of the account object under the pleroma
key:
{
"account": {
"pleroma": {
"privileges": [
"users_read",
"users_manage_invites",
"users_manage_activation_state",
"users_manage_tags",
"users_manage_credentials",
"users_delete",
"messages_read",
"messages_delete",
"instances_delete",
"reports_manage_reports",
"moderation_log_read",
"announcements_manage_announcements",
"emoji_manage_emoji",
"statistics_read"
]
}
}
Edited by Ilja