public void UpdateRules_No_Service() { String strErrorResut = String.Empty; UpdateRulesService svc = new UpdateRulesService(); UpdateRulesReq req = new UpdateRulesReq(); req.BusinessData.FwkAuthorizationRuleList = new Fwk.Security.FwkAuthorizationRuleList(); req.BusinessData.FwkAuthorizationRuleList.Add(new Fwk.Security.FwkAuthorizationRule("rule_1", "(R:Admin OR R:User)")); req.SecurityProviderName = SecurityProviderName; try { UpdateRulesRes res = svc.Execute(req); } catch (Exception ex) { strErrorResut = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex); } Assert.AreEqual <String>(strErrorResut, string.Empty, strErrorResut); }
/// <summary> /// Asocia un rol a determinadas reglas /// </summary> /// <param name="pRol"></param> /// <param name="pRulesList">Lista de reglas que queda asociada al nuevo rol</param> /// <param name="pPerformRemoveRoles"></param> public static void RulesUpdateService(Rol pRol, FwkAuthorizationRuleList pRulesList, bool pPerformRemoveRoles) { if (pPerformRemoveRoles) { RulesRemoveRol(pRol, pRulesList); } else { RulesApendRol(pRol, pRulesList); } UpdateRulesReq req = new UpdateRulesReq(); req.BusinessData.FwkAuthorizationRuleList = pRulesList; UpdateRulesRes res = req.ExecuteService <UpdateRulesReq, UpdateRulesRes>(WrapperSecurityProvider, req); if (res.Error != null) { Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error); } }
public void UpdateRules_No_Service() { String strErrorResut = String.Empty; UpdateRulesService svc = new UpdateRulesService(); UpdateRulesReq req = new UpdateRulesReq(); req.BusinessData.FwkAuthorizationRuleList = new Fwk.Security.FwkAuthorizationRuleList(); req.BusinessData.FwkAuthorizationRuleList.Add(new Fwk.Security.FwkAuthorizationRule("rule_1", "(R:Admin OR R:User)")); req.SecurityProviderName = SecurityProviderName; try { UpdateRulesRes res = svc.Execute(req); } catch (Exception ex) { strErrorResut = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex); } Assert.AreEqual<String>(strErrorResut, string.Empty, strErrorResut); }
/// <summary> /// Asocia un rol a determinadas reglas /// </summary> /// <param name="pRol"></param> /// <param name="pRulesList">Lista de reglas que queda asociada al nuevo rol</param> /// <param name="pPerformRemoveRoles"></param> public static void RulesUpdateService(Rol pRol, FwkAuthorizationRuleList pRulesList, bool pPerformRemoveRoles) { if (pPerformRemoveRoles) RulesRemoveRol(pRol, pRulesList); else RulesApendRol(pRol, pRulesList); UpdateRulesReq req = new UpdateRulesReq(); req.BusinessData.FwkAuthorizationRuleList = pRulesList; UpdateRulesRes res = req.ExecuteService<UpdateRulesReq, UpdateRulesRes>(WrapperSecurityProvider,req); if (res.Error != null) Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error); }