BasePermissionService class
namespace: Serenity.Extensions assembly: Serenity.Extensions
Base permission service that provides common functionality for permission services.
public abstract class BasePermissionService : IPermissionService, ITransientGrantor
| parameter |
description |
| userAccessor |
User accessor |
| rolePermissions |
Role permission service |
| httpContextItemsAccessor |
HTTP context items accessor |
Public Members
Protected Members
| name |
description |
| BasePermissionService(…) |
Base permission service that provides common functionality for permission services. |
| virtual AnonymousUsersHavePermission(…) |
Checks if anonymous users have the specified permission. By default, they don't have any permission. |
| abstract GetUserRoles(…) |
Gets the roles of the specified user. |
| virtual HasImpersonationPermission(…) |
Returns true if the provided user has the permission to impersonate as another user. Unless overridden, no user have this permission. |
| virtual IsAsterisk(…) |
Gets whether the specified permission is an asterisk, e.g. "*" that grants permission to all including anonymous users. |
| virtual IsDeny(…) |
Gets whether the specified permission is "DENY", which denies access to all users including super administrators. |
| virtual IsImpersonationPermission(…) |
Gets whether the specified permission is an impersonation permission. By default, impersonation permissions are permissions that start with "ImpersonateAs". |
| virtual IsQuestionMark(…) |
Gets whether the specified permission is a question mark, e.g. "?" that grants permission to logged in users. |
| virtual IsSuperAdmin(…) |
Gets whether the specified user is a super admin. |
| virtual IsTransientlyGranted(…) |
Checks if the transient grantor has the specified permission. |
| virtual IsValidKey(…) |
Gets whether the specified permission is a valid permission key. By default, a permission key is valid if it is not null or empty. |
| virtual SuperAdminHasPermission(…) |
Checks if the super admin has the specified permission. By default, super admin has all permissions. |
| abstract UserHasPermission(…) |
Gets if user has the specified permission directly, not via roles. Returns null if permission is not granted or denied directly. |
See Also