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) }); }
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() }); }
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() }); }
protected override bool AuthorizeCore(System.Web.HttpContextBase httpContext) { if (!CurrentRequestData.CurrentUser.IsActive) { return(false); } ACLRule aclRule = (Activator.CreateInstance(_type) as ACLRule); return(aclRule != null && aclRule.CanAccess(CurrentRequestData.CurrentUser, _operation, null)); }
public static ACLOption Create(ACLRule rule, string operation) { return(new ACLOption { Operation = operation, Rule = rule }); }