Teams & Permissions
How the flat permission model works, and how to check what a user can do.
Bots, servers, and packs can be owned directly by a user or by a team. Teams let multiple people share management of a listing, each with their own, separately scoped set of permissions.
The permission model
Permissions are flat strings, edit_bots, manage_webhooks,
view_sessions, and so on. There are no namespaces, wildcards, or
negation, a member either holds a permission or doesn't. One permission,
owner, is a super-permission that implies every other one on that team.
Checking what a user can do
Returns the resolved permissions a user has on any bot, server, team, or pack, whether they hold it directly or through team membership:
An empty list means the user has no access to that entity at all.
Team membership
Team members are added and edited with a flat list of permission strings per member:
There's no concept of roles or groups, permissions are assigned directly
to each member. A member with owner has full control, including adding
and removing other members.
The full permission catalogue
Returns every permission that exists in the entity domain, with its category and description, this is the same list a permission picker in a UI would use to build its options from, rather than hardcoding permission names on the client.