IPermitRepository<TId,TEntityId>
Members
Namespace: ASPSecurityKit
Assembly: ASPSecurityKit.dll
Summary
Provides an abstraction to implement a repository for IPermit<TId> in the database/ORM technology of your choice.
Generic Types
Name | Description |
---|---|
TId | The type of key identifier used in the application. |
TEntityId | The type of entityId property for IPermit<TId>. |
Methods
GetUserPermits(userId)
Summary
Gets a collection of IPermit<TId> objects representing all the activity-based permits for the specified userId.
Returns
A collection of IPermit<TId> objects representing all the activity-based permits for the specified userId.
Parameters
Name | Type | Description |
---|---|---|
userId | TId | Identifier of the user for which permits are to be retrieved. |
GetGroupPermits(permitGroupId)
Summary
Gets a collection of IPermit<TId> objects representing all the activity-based permits for the specified permitGroupId.
Returns
A collection of IPermit<TId> objects representing all the activity-based permits for the specified permitGroupId.
Parameters
Name | Type | Description |
---|---|---|
permitGroupId | TId | Identifier of the group for which permits are to be retrieved. |
AddPermit(permit)
Summary
Adds a permit to the database.
Returns
true
if permit is successfully added; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
permit | ASPSecurityKit.IPermit | The IPermit object that represents a unique permission to be added to the data store. |
Remarks
Note to implementers: you must return false if an exact permit for the specified user already exists. for any other issue, you should throw exception.
RemovePermit(permit)
Summary
Removes the specified permit from the database.
Returns
true
if permit is successfully removed; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
permit | ASPSecurityKit.IPermit | The IPermit object that represents a unique permit to be removed from the database. |
Remarks
Note to implementers: you must return false if no such permit exists for the specified user. for any other issue, you should throw exception.
GetUserPermitsAsync(userId)
Summary
Gets a collection of IPermit<TId> objects representing all the activity-based permits for the specified userId.
Returns
A collection of IPermit<TId> objects representing all the activity-based permits for the specified userId.
Parameters
Name | Type | Description |
---|---|---|
userId | TId | Identifier of the user for which permits are to be retrieved. |
GetUserPermitsAsync(userId,cancellationToken)
Summary
Gets a collection of IPermit<TId> objects representing all the activity-based permits for the specified userId.
Returns
A collection of IPermit<TId> objects representing all the activity-based permits for the specified userId.
Parameters
Name | Type | Description |
---|---|---|
userId | TId | Identifier of the user for which permits are to be retrieved. |
cancellationToken | System.Threading.CancellationToken | The cancellation token. |
GetGroupPermitsAsync(permitGroupId)
Summary
Gets a collection of IPermit<TId> objects representing all the activity-based permits for the specified permitGroupId.
Returns
A collection of IPermit<TId> objects representing all the activity-based permits for the specified permitGroupId.
Parameters
Name | Type | Description |
---|---|---|
permitGroupId | TId | Identifier of the group for which permits are to be retrieved. |
GetGroupPermitsAsync(permitGroupId,cancellationToken)
Summary
Gets a collection of IPermit<TId> objects representing all the activity-based permits for the specified permitGroupId.
Returns
A collection of IPermit<TId> objects representing all the activity-based permits for the specified permitGroupId.
Parameters
Name | Type | Description |
---|---|---|
permitGroupId | TId | Identifier of the group for which permits are to be retrieved. |
cancellationToken | System.Threading.CancellationToken | The cancellation token. |
AddPermitAsync(permit)
Summary
Adds a permit to the database.
Returns
true
if permit is successfully added; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
permit | ASPSecurityKit.IPermit | The IPermit object that represents a unique permission to be added to the data store. |
Remarks
Note to implementers: you must return false if an exact permit for the specified user already exists. for any other issue, you should throw exception.
AddPermitAsync(permit,cancellationToken)
Summary
Adds a permit to the database.
Returns
true
if permit is successfully added; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
permit | ASPSecurityKit.IPermit | The IPermit object that represents a unique permission to be added to the data store. |
cancellationToken | System.Threading.CancellationToken | The cancellation token. |
Remarks
Note to implementers: you must return false if an exact permit for the specified user already exists. for any other issue, you should throw exception.
RemovePermitAsync(permit)
Summary
Removes the specified permit from the database.
Returns
true
if permit is successfully removed; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
permit | ASPSecurityKit.IPermit | The IPermit object that represents a unique permit to be removed from the database. |
Remarks
Note to implementers: you must return false if no such permit exists for the specified user. for any other issue, you should throw exception.
RemovePermitAsync(permit,cancellationToken)
Summary
Removes the specified permit from the database.
Returns
true
if permit is successfully removed; otherwise, false
.
Parameters
Name | Type | Description |
---|---|---|
permit | ASPSecurityKit.IPermit | The IPermit object that represents a unique permit to be removed from the database. |
cancellationToken | System.Threading.CancellationToken | The cancellation token. |
Remarks
Note to implementers: you must return false if no such permit exists for the specified user. for any other issue, you should throw exception.