Method Can
Can<T>(IEntitySecurity<T>, Operation, T, object)
Checks if the specified entity security allows the specified operation on the given entity.
public static bool Can<T>(this IEntitySecurity<T> entitySecurity, Operation operation, T entity, object sourceEntity = null) where T : class
Parameters
entitySecurity
IEntitySecurity<T>The entity security instance.
operation
OperationThe operation to check.
entity
TThe entity to check.
sourceEntity
objectThe source entity.
Returns
- bool
true
if the operation is allowed; otherwise,false
.
Type Parameters
T
The type of the entity.
Can<T>(IEntitySecurity<T>, Operation, IPrimaryKey)
Checks if the specified entity security allows the specified operation on the entity with the specified primary keys.
public static bool Can<T>(this IEntitySecurity<T> entitySecurity, Operation operation, IPrimaryKey keys) where T : class
Parameters
entitySecurity
IEntitySecurity<T>The entity security instance.
operation
OperationThe operation to check.
keys
IPrimaryKeyThe primary keys of the entity.
Returns
- bool
true
if the operation is allowed; otherwise,false
.
Type Parameters
T
The type of the entity.
Can<T>(IEntitySecurity<T>, Operation)
Checks if the specified entity security allows the specified operation.
public static bool Can<T>(this IEntitySecurity<T> entitySecurity, Operation operation) where T : class
Parameters
entitySecurity
IEntitySecurity<T>The entity security instance.
operation
OperationThe operation to check.
Returns
- bool
true
if the operation is allowed; otherwise,false
.
Type Parameters
T
The type of the entity.