Inheritance: Permission
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }