I think the endpoint should be users/@me/realms/:realm_id/roles. We also have /users/@me/pins/realms/{realm_id}, but I think there's an argument to be made that because a lot of user resources are depending on the specific realm, the realm should be the prefix in the URL. So:
users/@me/realms/:realm_id/roles
users/@me/realms/:realm_id/pins
users/@me/realms/:realm_id/bobadex
etc.
For the data, I would structure it something like:
{
roles: [{
id,
name,
avatar,
color,
description,
accessory,
boards: [/*the ids of the boards this role applies to*/],
permissions: {
board_permissions: [/*the names of the permissions that apply to this role*],
post_permissions: [/*the names of the permissions that apply to this role*],
thread_permissions: [/*the names of the permissions that apply to this role*],
realm_permissions: [/*the names of the permissions that apply to this role*],
}
}]
}
See #https://github.com/BobaBoard/boba-components/issues/119 for the data that needs to be passed down to the frontend.
I think the endpoint should be
users/@me/realms/:realm_id/roles
. We also have/users/@me/pins/realms/{realm_id}
, but I think there's an argument to be made that because a lot of user resources are depending on the specific realm, the realm should be the prefix in the URL. So:users/@me/realms/:realm_id/roles
users/@me/realms/:realm_id/pins
users/@me/realms/:realm_id/bobadex
etc.
For the data, I would structure it something like:
One relevant OpenAPI type:
We will need to create one for Role