Inheritance: BaseEntity
Ejemplo n.º 1
0
 public static FeatureModel Convert(Feature feature)
 {
     return new FeatureModel()
     {
         Id = feature.Id,
         FeatureName = feature.Name,
         Description = feature.Description,
         Children = feature.Children.Select(c => FeatureModel.Convert(c)).ToList<FeatureModel>()
     };
 }
Ejemplo n.º 2
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
            };
        }
Ejemplo 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
            };
        }
Ejemplo n.º 4
0
        public static FeatureTreeViewModel Convert(Feature feature, IsFeatureInEveryoneGroupDelegate isFeatureInEveryoneGroupDelegate)
        {
            return new FeatureTreeViewModel()
            {
                Id = feature.Id,
                FeatureName = feature.Name,
                Description = feature.Description,

                IsFeatureInEveryoneGroup = isFeatureInEveryoneGroupDelegate(feature.Id),

                Children = feature.Children.Select(c => FeatureTreeViewModel.Convert(c, isFeatureInEveryoneGroupDelegate)).ToList<FeatureTreeViewModel>()
            };
        }