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 void ActRejectFlow(Action<ApprovmentDto, Exception> action, long entityId, ActionEntityTypeEnum entityTypeId)
        {
            var url = string.Format(approvalFlowAddressStringFormat, entityId);
            var ent = new ApprovmentDto
                          {
                              EntityId = entityId,
                              DecisionType = DecisionTypeEnum.Rejected,
                              ActionEntityType = entityTypeId
                          };

            WebClientHelper.Put<ApprovmentDto, ApprovmentDto>(new Uri(url, UriKind.Absolute),
                                                       (res, exp) => action(res, exp), ent,
                                                       WebClientHelper.MessageFormat.Json, ApiConfig.Headers);
        }
Example #3
0
 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;
 }