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); }
public DataPermission UpdateDataPermission(DataPermission dataPermission) { using (IUnitOfWork uow = this.GetUnitOfWork()) { IRepository<DataPermission> usersRepo = uow.GetRepository<DataPermission>(); usersRepo.Put(dataPermission); uow.Commit(); } return (dataPermission); }