Interface IAuthorityRepository
- Namespace
- adas_core.Application.Repositories.Interfaces
- Assembly
- adas-core.Application.dll
public interface IAuthorityRepository : IMongoRepository<Authorization>
- Inherited Members
- Extension Methods
Methods
CreateNewAuthority(string, ObjectId)
Creates a new authority assignment for the specified user with the given role name.
void CreateNewAuthority(string roleName, ObjectId userId)
Parameters
roleNamestringThe name of the role to assign as the new authority.
userIdObjectIdThe identifier of the user to whom the authority will be assigned.
DeleteAllAuthoritiesByDisplay(ObjectId)
Deletes all authorities associated with the specified display identifier.
Task<bool> DeleteAllAuthoritiesByDisplay(ObjectId displayId)
Parameters
displayIdObjectIdThe identifier of the display whose related authorities should be removed.
Returns
DeleteAllAuthoritiesByUnit(ObjectId)
Deletes all authorities associated with the specified unit.
Task<bool> DeleteAllAuthoritiesByUnit(ObjectId unitId)
Parameters
unitIdObjectIdThe unique identifier of the unit whose authorities should be removed.
Returns
- Task<bool>
A task that resolves to
trueif the authorities were successfully deleted; otherwise,false.
DeleteAllAuthoritiesByUser(ObjectId)
Asynchronously deletes all authorities associated with the specified user.
Task<bool> DeleteAllAuthoritiesByUser(ObjectId userId)
Parameters
userIdObjectIdThe unique identifier of the user whose authorities will be removed.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result is
trueif authorities were deleted; otherwise,false.
GetAllAuthorities()
Asynchronously retrieves all available 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.
GetById(ObjectId)
Retrieves an Authorization entity by its unique identifier asynchronously.
Task<Authorization> GetById(ObjectId authId)
Parameters
authIdObjectIdThe unique identifier of the authorization to retrieve.
Returns
- Task<Authorization>
A task that represents the asynchronous operation, containing the Authorization that matches the specified identifier.
GetByUnitId(ObjectId)
Retrieves a list of authorizations associated with the specified unit identifier.
Task<List<Authorization>> GetByUnitId(ObjectId unitId)
Parameters
unitIdObjectIdThe unique identifier of the unit whose authorizations are being requested.
Returns
- Task<List<Authorization>>
A task that represents the asynchronous operation, containing a list of Authorization objects matching the provided unit identifier.
GetUserAuthorities(ObjectId)
Retrieves the list of authorizations (authorities/permissions) associated with the specified user.
Task<List<Authorization>> GetUserAuthorities(ObjectId userId)
Parameters
userIdObjectIdThe unique identifier of the user whose authorities are being requested.
Returns
- Task<List<Authorization>>
A task that represents the asynchronous operation. The task result contains the list of Authorization entries assigned to the user.