Private
Readonly
prismaAssigns a role to a user.
The data for assigning the role to the user.
A promise that resolves when the role is assigned to the user successfully.
If the user or role with the specified ID is not found.
If the user already has the specified role.
Creates a new permission.
The data for creating the new permission.
A promise that resolves to the created Permission object.
If the permission with the same name already exists.
Creates a new role.
The data for creating the new role.
A promise that resolves to the created Role object.
If the role with the same name already exists.
Deactivate a Permission by its ID.
The ID of the role to delete.
A promise that resolves when the role is deleted successfully.
If the role with the specified ID is not found.
If the role has already been deleted.
Retrieves a permission by its ID.
The ID of the permission to retrieve.
A promise that resolves to the Permission object with the given ID.
If the permission with the specified ID is not found.
Retrieves a list of all permissions.
A promise that resolves to an array of Permission objects.
Retrieves a list of permissions assigned to a user.
The ID of the user.
A promise that resolves to an array of Permission objects.
Retrieves a role by its ID.
The ID of the role to retrieve.
A promise that resolves to the Role object with the given ID.
If the role with the specified ID is not found.
Retrieves a list of all roles.
A promise that resolves to an array of Role objects.
Checks if a user has specific permissions.
The ID of the user.
An array of permission names required for access.
A promise that resolves to true if the user has all the required permissions; otherwise, false.
Checks if a user has specific roles.
The ID of the user.
An array of role names required for access.
A promise that resolves to true if the user has all the required roles; otherwise, false.
Removes permissions from a role based on the provided DTO.
The DTO containing roleId and permissionIds.
If the role or permission is not found.
If a permission is not associated with the role.
Disconnects a role from a user based on the provided DTO.
The DTO containing userId and roleId.
If the user or role is not found.
If the user doesn't have the specified role.
Updates a permission by its ID.
The ID of the permission to update.
The data for updating the permission.
A promise that resolves to the updated Permission object.
If the permission with the specified ID is not found.
Generated using TypeDoc
Service class responsible for handling Role-Based Access Control (RBAC) operations.