Interface IAuthorityService
- Namespace
- adas_core.Authentication.Interfaces
- Assembly
- adas-core.Authentication.dll
public interface IAuthorityService
- Extension Methods
Methods
CreateNew(string, ObjectId)
Creates a new role with the specified name and associates it with the given user.
void CreateNew(string roleName, ObjectId userId)
Parameters
roleNamestringThe name of the role to create.
userIdObjectIdThe identifier of the user to associate with the new role.
CreateNewUserAuthority(Authorization)
Creates a new user authority based on the provided authorization.
Task<Authorization?> CreateNewUserAuthority(Authorization authorization)
Parameters
authorizationAuthorizationThe authorization data used to create the new user authority.
Returns
- Task<Authorization>
A task that represents the asynchronous operation. The task result contains the created Authorization, or
nullif the authority could not be created.
DeleteAuthoritiesForUser(ObjectId)
Deletes all authorities associated with the user identified by the specified id.
Task<bool> DeleteAuthoritiesForUser(ObjectId id)
Parameters
idObjectIdThe unique identifier of the user whose authorities should be removed.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result contains
trueif authorities were deleted; otherwise,false.
DeleteUserAuthority(ObjectId)
Asynchronously deletes a user authority identified by the provided parsed identifier.
Task<bool> DeleteUserAuthority(ObjectId userAuthorityIdParsed)
Parameters
userAuthorityIdParsedObjectIdThe parsed identifier of the user authority to delete.
Returns
- Task<bool>
A task that represents the asynchronous delete operation. The task result is true if the user authority was successfully deleted; otherwise, false.
EditUserAuthority(Authorization)
Edits the user authority using the provided authorization data.
Task<Authorization?> EditUserAuthority(Authorization authorization)
Parameters
authorizationAuthorizationThe authorization object containing the user authority details to be updated.
Returns
- Task<Authorization>
A task that represents the asynchronous operation. The task result contains the updated Authorization, or
nullif the authorization was not found.
GetAllAuthorities()
Asynchronously retrieves all authorizations.
Task<List<Authorization>> GetAllAuthorities()
Returns
- Task<List<Authorization>>
A task that represents the asynchronous operation. The task result contains a list of all authorization objects.
GetUserAuthorities(ObjectId)
Asynchronously retrieves the list of authorizations associated with the specified user.
Task<List<Authorization>> GetUserAuthorities(ObjectId userId)
Parameters
userIdObjectIdThe unique identifier of the user whose authorizations are being requested.
Returns
- Task<List<Authorization>>
A task that represents the asynchronous operation, containing a list of Authorization objects for the user.
InsertOne(Authorization)
Inserts a new authorization record into the data store.
Task InsertOne(Authorization authorization)
Parameters
authorizationAuthorizationThe authorization entity to insert.
Returns
- Task
A task that represents the asynchronous insert operation.
updateOne(Authorization)
Updates a single authorization record.
Task updateOne(Authorization authorization)
Parameters
authorizationAuthorizationThe authorization object containing the data to be updated.