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
entitySecurityIEntitySecurity<T>The entity security instance.
operationOperationThe operation to check.
entityTThe entity to check.
sourceEntityobjectThe source entity.
Returns
- bool
trueif the operation is allowed; otherwise,false.
Type Parameters
TThe 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
entitySecurityIEntitySecurity<T>The entity security instance.
operationOperationThe operation to check.
keysIPrimaryKeyThe primary keys of the entity.
Returns
- bool
trueif the operation is allowed; otherwise,false.
Type Parameters
TThe 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
entitySecurityIEntitySecurity<T>The entity security instance.
operationOperationThe operation to check.
Returns
- bool
trueif the operation is allowed; otherwise,false.
Type Parameters
TThe type of the entity.