IEnumerable <ActionBase> GetModuleActions(IActionStateRule rule, IEnumerable <ActionBase> actionBases) { var assemblies = Application.Modules.Where(@base => new Regex(rule.Module).IsMatch(@base.GetType().FullName + "")).Select( @base => @base.GetType().Assembly.FullName).ToArray(); return(actionBases.Where(@base => assemblies.Contains(@base.Controller.GetType().Assembly.FullName))); }
IEnumerable<ActionBase> GetActions(IActionStateRule rule) { var actionBases = Frame.Actions(); if (!string.IsNullOrEmpty(rule.Module)) return GetModuleActions(rule, actionBases); var contextIds = GetActionContextIds(((ActionStateRule) rule).ActionContext); var ids = new[]{rule.ActionId}.Concat(contextIds).ToArray(); return actionBases.Where(@base => ids.Contains(@base.Id)); }
IEnumerable<ActionBase> GetActions(IActionStateRule rule) { IEnumerable<ActionBase> actionBases = Frame.Controllers.Cast<Controller>().SelectMany(controller => controller.Actions); if (!string.IsNullOrEmpty(rule.Module)) return GetModuleActions(rule, actionBases); var result = new List<ActionBase>(); ActionBase actionBase = actionBases.Where(@base => @base.Id == rule.ActionId).Select(@base => @base).SingleOrDefault(); if (actionBase != null) result.Add(actionBase); return result; }
IEnumerable <ActionBase> GetActions(IActionStateRule rule) { var actionBases = Frame.Actions(); if (!string.IsNullOrEmpty(rule.Module)) { return(GetModuleActions(rule, actionBases)); } var contextIds = GetActionContextIds(((ActionStateRule)rule).ActionContext); var ids = new[] { rule.ActionId }.Concat(contextIds).ToArray(); return(actionBases.Where(@base => ids.Contains(@base.Id))); }
IEnumerable <ActionBase> GetActions(IActionStateRule rule) { IEnumerable <ActionBase> actionBases = Frame.Controllers.Cast <Controller>().SelectMany(controller => controller.Actions); if (!string.IsNullOrEmpty(rule.Module)) { return(GetModuleActions(rule, actionBases)); } var result = new List <ActionBase>(); ActionBase actionBase = actionBases.Where(@base => @base.Id == rule.ActionId).Select(@base => @base).SingleOrDefault(); if (actionBase != null) { result.Add(actionBase); } return(result); }
IEnumerable<ActionBase> GetModuleActions(IActionStateRule rule, IEnumerable<ActionBase> actionBases) { var assemblies =Application.Modules.Where(@base => new Regex(rule.Module).IsMatch(@base.GetType().FullName + "")).Select( @base => @base.GetType().Assembly.FullName).ToArray(); return actionBases.Where(@base => assemblies.Contains(@base.Controller.GetType().Assembly.FullName)); }
public ActionStateRulePermission(IActionStateRule logicRule) : base(OperationName, logicRule) { ActionId = logicRule.ActionId; ActionState = logicRule.ActionState; }
public ActionStateRule(IActionStateRule actionStateRule) : base(actionStateRule) { ActionId = actionStateRule.ActionId; ActionState = actionStateRule.ActionState; }
public ActionStateRule(IActionStateRule actionStateRule) : base(actionStateRule) { ActionId = actionStateRule.ActionId; ActionState = actionStateRule.ActionState; }