Inheritance: BaseEntity
Esempio n. 1
0
        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
            };
        }
Esempio n. 2
0
        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
            };
        }
Esempio n. 3
0
        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
            };
        }