Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        /// <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);
            }
        }
Esempio n. 3
0
        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);

        }
Esempio n. 4
0
        /// <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);
        }