deseasion.backend.services.permission_service module
- deseasion.backend.services.permission_service.get_all_users()
Returns the list of all the users in the application
- deseasion.backend.services.permission_service.has_ability(ability)
Check that a user has the necessary ability
Executes the decorated function if the user has the abilty, otherwise raises an error.
- Raises:
PermissionError if the user does not have the ability
- deseasion.backend.services.permission_service.has_permission(obj, user=None)
Check if the user of the request is authorized to use the object
Returns a boolean indicating if the user has permissions on the object.
- Args:
- user:
The user to check for the permission. Default: None (load the user from the token).
- deseasion.backend.services.permission_service.has_permission_for_id(obj_class, obj_id)
Check if the user of the request is authorized to use the object with the given id