예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        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);
                }
            }
        }