Esempio n. 1
0
 public static ACLAvailableModel Create(ACLRoleModel role, ACLRule rule, string operation, Type type)
 {
     return new ACLAvailableModel
                {
                    Role = role,
                    IsAllowed = rule.CanAccess(role.Role, operation, type == null ? null : type.FullName)
                };
 }
Esempio n. 2
0
 public static ACLRuleOperationModel Create(List<ACLRoleModel> roles, ACLRule rule, ACLOperation operation, Type type)
 {
     return new ACLRuleOperationModel
                {
                    DisplayName = operation.Name,
                    Key = operation.Key,
                    Roles = roles.Select(role => ACLAvailableModel.Create(role, rule, operation.Name, type)).ToList()
                };
 }
Esempio n. 3
0
 public static ACLRuleModel Create(List<ACLRoleModel> roles, ACLRule rule, ACLGroup group)
 {
     return new ACLRuleModel
                {
                    Name = group.Name,
                    AppName = group.AppName,
                    Operations = group.Operations.Select(operation => ACLRuleOperationModel.Create(roles, rule, operation, group.Type)).ToList()
                };
 }
Esempio n. 4
0
 public static ACLOption Create(ACLRule rule, string operation)
 {
     return new ACLOption {Operation = operation, Rule = rule};
 }