raito.plugins.roles.manager moduleΒΆ
- class raito.plugins.roles.manager.RoleManager(provider, developers=None)[source]ΒΆ
Bases:
objectCentral manager for role-based access control in Raito.
- Parameters:
provider (IRoleProvider)
- async can_manage_roles(bot_id, user_id)[source]ΒΆ
Check whether the user can manage other usersβ roles.
- async assign_role(bot_id, initiator_id, target_id, role_slug)[source]ΒΆ
Assign a role to a user.
- Parameters:
- Raises:
PermissionError β If the user does not have permission to assign role
- Return type:
None
- async revoke_role(bot_id, initiator_id, target_id)[source]ΒΆ
Revoke a userβs role.
- Parameters:
- Raises:
PermissionError β If the user does not have permission to revoke roles
- Return type:
None
- async has_any_roles(bot_id, user_id, *roles)[source]ΒΆ
Check if a user has any of the specified roles.