public bool IsAuthorize(ActionEntityTypeEnum workflowEntities, DecisionTypeEnum decisionTypeEnum, ClaimsPrincipal userClaimsPrincipal) { var methodMapper = new MethodMapper(); var methodRequiredActions = methodMapper.MapWF(workflowEntities, decisionTypeEnum); List<ActionType> userActions = _userActionMapper.MapToEntity(userClaimsPrincipal); return _securityApplicationService.IsAuthorize(userActions, methodRequiredActions); }
public List<ActionType> MapWF(ActionEntityTypeEnum workflowEntitie, DecisionTypeEnum decisionTypeEnum) { var mapRow = MapTableWorkFlow.Where(m => m.ClassName == workflowEntitie.ToString() && m.MethodName == decisionTypeEnum.ToString()); if (!mapRow.Any()) return new List<ActionType>(); return mapRow.FirstOrDefault().Actions; }