상속: Permission
예제 #1
0
        public DataPermission CreateDataPermission(long subjectId, long entityId, long dataId, RightType rightType, PermissionType permissionType = PermissionType.Grant)
        {
            DataPermission dataPermission = new DataPermission()
            {
                Subject = SubjectsRepo.Get(subjectId),
                Entity = EntitiesRepo.Get(entityId),
                DataId = dataId,
                RightType = rightType,
                PermissionType = permissionType
            };

            using (IUnitOfWork uow = this.GetUnitOfWork())
            {
                IRepository<DataPermission> featuresRepo = uow.GetRepository<DataPermission>();
                featuresRepo.Put(dataPermission);

                uow.Commit();
            }

            return (dataPermission);
        }
예제 #2
0
        public DataPermission UpdateDataPermission(DataPermission dataPermission)
        {
            using (IUnitOfWork uow = this.GetUnitOfWork())
            {
                IRepository<DataPermission> usersRepo = uow.GetRepository<DataPermission>();
                usersRepo.Put(dataPermission);
                uow.Commit();
            }

            return (dataPermission);
        }