Interface IPermissionService
- Namespace
- adas_core.Application.Services.Interfaces
- Assembly
- adas-core.Application.dll
public interface IPermissionService
- Extension Methods
Methods
GetPermissionsForDisplay(Display, User)
Retrieves the set of display permission types applicable to the specified user for the given display.
Task<DisplayPermissionTypes> GetPermissionsForDisplay(Display display, User user)
Parameters
displayDisplayThe display for which permissions are being evaluated.
userUserThe user whose permissions for the display are being retrieved.
Returns
- Task<DisplayPermissionTypes>
A task that represents the asynchronous operation, containing the DisplayPermissionTypes granted to the user for the display.
GetPermissionsForPanel(string)
Retrieves the panel permission types associated with the specified user.
Task<PanelPermissionTypes> GetPermissionsForPanel(string user)
Parameters
userstringThe identifier or name of the user whose panel permissions are being requested.
Returns
- Task<PanelPermissionTypes>
A task that represents the asynchronous operation, containing the PanelPermissionTypes granted to the user.
GetPermissionsForPanel(User)
Retrieves the panel permission types associated with the specified user.
PanelPermissionTypes GetPermissionsForPanel(User user)
Parameters
userUserThe user whose panel permissions are being queried.
Returns
- PanelPermissionTypes
The PanelPermissionTypes granted to the specified user.
GetPermissionsForUnit(string, User)
Retrieves the display-friendly permission types applicable to the specified user for the given unit.
Task<DisplayPermissionTypes> GetPermissionsForUnit(string unitId, User user)
Parameters
unitIdstringThe identifier of the unit whose permissions are being queried.
userUserThe user whose permissions for the unit should be evaluated.
Returns
- Task<DisplayPermissionTypes>
A task that represents the asynchronous operation, containing the DisplayPermissionTypes for the specified unit and user.
HasAccessToDisplay(string, RolesType, SourcePermissionsEnum, string)
Asynchronously checks whether the specified user, with the given role and source permission, has access to the specified display.
Task<bool> HasAccessToDisplay(string username, PermissionEnum.RolesType role, PermissionEnum.SourcePermissionsEnum source, string displayId)
Parameters
usernamestringThe name of the user whose access is being verified.
rolePermissionEnum.RolesTypeThe role assigned to the user, used to determine access rights.
sourcePermissionEnum.SourcePermissionsEnumThe source permission type considered when evaluating access.
displayIdstringThe identifier of the display for which access is being checked.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result is
trueif the user has access to the display; otherwise,false.
HasAccessToPanel(string, RolesType, SourcePermissionsEnum)
Asynchronously determines whether the specified user has access to a panel based on their role and the requested source permission.
Task<bool> HasAccessToPanel(string username, PermissionEnum.RolesType role, PermissionEnum.SourcePermissionsEnum source)
Parameters
usernamestringThe identifier of the user whose panel access is being evaluated.
rolePermissionEnum.RolesTypeThe role assigned to the user, used to resolve applicable permissions.
sourcePermissionEnum.SourcePermissionsEnumThe source permission being checked against the user's access rights.
Returns
HasAccessToUnit(string, RolesType, SourcePermissionsEnum, string)
Asynchronously determines whether the specified user, with the given role and permission source, has access to the identified unit.
Task<bool> HasAccessToUnit(string username, PermissionEnum.RolesType role, PermissionEnum.SourcePermissionsEnum source, string unitId)
Parameters
usernamestringThe identifier of the user whose access is being evaluated.
rolePermissionEnum.RolesTypeThe role assigned to the user, used in the access evaluation.
sourcePermissionEnum.SourcePermissionsEnumThe permission source used to resolve the user's access rights.
unitIdstringThe identifier of the unit to check access against.