public static FeaturePermissionGridRowModel Convert(Subject subject, Feature feature, int featurePermissionType, bool effectiveRight) { return new FeaturePermissionGridRowModel() { FeatureId = feature.Id, SubjectId = subject.Id, SubjectName = subject.Name, SubjectType = subject is User ? "User" : "Group", EffectiveRight = effectiveRight, FeaturePermissionType = featurePermissionType }; }
public static DatasetPermissionGridRowModel Convert(long dataId, Entity entity, Subject subject, List<int> rights) { return new DatasetPermissionGridRowModel() { DataId = dataId, EntityId = entity.Id, SubjectId = subject.Id, SubjectName = subject.Name, SubjectType = subject is User ? "User" : "Group", Rights = rights }; }
public static FeaturePermissionModel Convert(Feature feature, Subject subject, bool existsPermission, bool effectiveRight) { return new FeaturePermissionModel() { FeatureId = feature.Id, FeatureName = feature.Name, FeatureDescription = feature.Description, SubjectId = subject.Id, SubjectName = subject.Name, SubjectType = subject is User ? "User" : "Role", ExistsPermission = existsPermission, EffectiveRight = effectiveRight }; }