superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.66k stars 308 forks source link

[feature] Admin role permission bitmask #3115

Closed GeopJr closed 1 month ago

GeopJr commented 1 month ago

Is your feature request related to a problem ?

This is extremely low priority.

Mastodon 4.0.0 added role permissions, a bitmask of individual permissions the role has. Apps that have admin tools, can utilize them to conditionally show them, e.g. a Moderator might not have permission to block federation and a client could just not show them the block federation tools at all or provide a helpful message rather than let it fail

https://docs.joinmastodon.org/entities/Role/#permissions

Describe the solution you'd like.

Since, from my understanding, GoToSocial has a preset of roles, admins should probably just have the 'Administrator' permission and mods should have the individual ones that best describe what they have access to

Describe alternatives you've considered.

From my side, I can skip the permission checks or use the role names since they are static

Additional context.

This is very niche and experimental and should really be treated as very low priority, as nobody but a handful of clients have admin tools at all (Though I will open more issues for the admin API in the future :3)

VyrCossont commented 1 month ago

Relevant for Mastodon compatibility: it has a role attribute on a subtype of Account (documented) and a roles attribute on Account proper (undocumented).

VyrCossont commented 1 month ago

Another thing I learned today is that GtS's moderator role doesn't appear to do anything other than make the account eligible to be listed as an instance contact. This will probably change in the future.