public void CheckPermission(TEntity entity, DataOperation dataOperation) { DataPrivilegeContext <TDbContext, TEntity, TRule> context = CreateDataPrivilegeContext(dataOperation); if (context != null) { if (!context.CheckPermission(entity)) { throw new NoAccessException(entity, dataOperation); } } }
public void CheckPermission(IEnumerable <TEntity> entities, DataOperation dataOperation) { DataPrivilegeContext <TDbContext, TEntity, TRule> context = CreateDataPrivilegeContext(dataOperation); if (context != null) { if (!context.CheckPermission(entities)) { var data = context.GetNoAccessData(entities); throw new NoAccessException(data, dataOperation); } } }