raito.plugins.roles.manager module¶
- class raito.plugins.roles.manager.RoleManager(provider, developers=None)[исходный код]¶
Базовые классы:
objectCentral manager for role-based access control in Raito.
- Параметры:
provider (IRoleProvider)
- async migrate()[исходный код]¶
Run provider migrations.
- Тип результата:
None
- async get_role(bot_id, user_id)[исходный код]¶
Get the role for a specific user.
- async can_manage_roles(bot_id, user_id)[исходный код]¶
Check whether the user can manage other users“ roles.
- async assign_role(bot_id, initiator_id, target_id, role_slug)[исходный код]¶
Assign a role to a user.
- Параметры:
- Исключение:
PermissionError – If the user does not have permission to assign role
- Тип результата:
None
- async revoke_role(bot_id, initiator_id, target_id)[исходный код]¶
Revoke a user’s role.
- Параметры:
- Исключение:
PermissionError – If the user does not have permission to revoke roles
- Тип результата:
None
- async has_any_roles(bot_id, user_id, *roles)[исходный код]¶
Check if a user has any of the specified roles.
- async has_role(bot_id, user_id, role_slug)[исходный код]¶
Check if a user has the specified roles.
- async get_users(bot_id, role)[исходный код]¶
Get a list of users with a specific role.
- get_role_data(slug)[исходный код]¶
Get data of specified role.