IPermitManager<TId>
Members
Namespace: ASPSecurityKit
Assembly: ASPSecurityKit.dll
Summary
Defines operations to manage permits for an authenticated session.
Generic Types
| Name | Description |
|---|---|
| TId | Type used by the application to represent unique identifier for entities or custom entity urn struct to represent entityId. |
Properties
Initialized
Summary
Gets a value indicating whether this instance is initialized.
Value
true if this instance is initialized; otherwise, false.
Remarks
Most operations are only available once the instance is initialized using Initialize. An exception could be thrown otherwise. Use this property to determine the initialization status safely.
Methods
Contains(permitHash)
Summary
Determines whether this instance contains the specified permit.
Returns
true if this instance contains the specified permit; otherwise, false.
Parameters
| Name | Type | Description |
|---|---|---|
| permitHash | System.String | The permit hash. |
Exceptions
| Type | Description |
|---|---|
| System.ArgumentNullException | When permitHash is null/whitespace. |
Possesses(permissionCode)
Summary
Determines whether this instance contains any permit having the specified permissionCode.
Returns
true if this instance contains some permit having the specified permissionCode; otherwise, false.
Parameters
| Name | Type | Description |
|---|---|---|
| permissionCode | System.String | The permission code. |
Exceptions
| Type | Description |
|---|---|
| System.ArgumentNullException | When permissionCode is null/whitespace. |
GetEntityIds(permissionCode)
Summary
Gets all the entity ids associated with the specified permissionCode across the entire permits collection this instance holds.
Returns
All the entity ids associated with the specified permissionCode across the entire permits collection this instance holds.
Parameters
| Name | Type | Description |
|---|---|---|
| permissionCode | System.String | The permission code. |
Exceptions
| Type | Description |
|---|---|
| System.ArgumentNullException | When permissionCode is null/whitespace. |
GetPermits()
Summary
Gets the entire permits collection this instance holds.
Returns
The entire permits collection this instance holds.
Parameters
This method has no parameters.
CreatePermitHash(permissionCode,entityId)
Summary
Creates a unique hash for the specified permissionCode and entityId.
Returns
A unique hash for the specified permissionCode and entityId.
Parameters
| Name | Type | Description |
|---|---|---|
| permissionCode | System.String | The permission code. |
| entityId | System.String | The entity identifier. |
Exceptions
| Type | Description |
|---|---|
| System.ArgumentNullException | When permissionCode is null/whitespace. |
CreatePermitHash(permissionCode,entityId)
Summary
Creates a unique hash for the specified permissionCode and entityId.
Returns
A unique hash for the specified permissionCode and entityId.
Parameters
| Name | Type | Description |
|---|---|---|
| permissionCode | System.String | The permission code. |
| entityId | System.Nullable<TId> | The entity identifier. |
Exceptions
| Type | Description |
|---|---|
| System.ArgumentNullException | When permissionCode is null/whitespace. |
Initialize(permits)
Summary
Initializes this instance with specified permits.
Parameters
| Name | Type | Description |
|---|---|---|
| permits | System.Collections.Generic.IEnumerable<IPermit<TId>> | The permits. |
Exceptions
| Type | Description |
|---|---|
| System.ArgumentNullException | When permits is null. |
Remarks
Every call to this method will completely override existing permits collection it holds.
Add(permit)
Summary
Adds the specified permit to the collection this instance holds.
Parameters
| Name | Type | Description |
|---|---|---|
| permit | ASPSecurityKit.IPermit<TId> | The permit to add. |
Exceptions
| Type | Description |
|---|---|
| System.ArgumentNullException | When permit is null. |
Clear()
Summary
Clears the data this instance holds.
Parameters
This method has no parameters.
GetStorageData()
Summary
Gets the data this instance holds in a raw format (to persist in external cache, for instance).
Returns
The data this instance holds in a raw format.
Parameters
This method has no parameters.
SetStorageData(data)
Summary
Re-initializes this instance with the specified raw data (previously obtained via GetStorageData).
Parameters
| Name | Type | Description |
|---|---|---|
| data | System.Object | The raw data. |