Example #1
0
        public ActionResult Save(RoleDto model)
        {
            var saveState = BusinessHelper.BuildSaveState(Request);

            var resourceList = Request["resourceList"];

            var array    = BusinessHelper.BreakUpStr(resourceList, ',');
            var arrayStr = BusinessHelper.BreakUpOptions(resourceList, ',');

            _roleBll.HttpPostSave(model, saveState, array);

            var actionList = Request["actionList"];

            var actionArr = BusinessHelper.BreakUpOptions(actionList, '|');

            //资源授权
            AuthConfigXmlHelper.UpateRolesAuthConfigByXml(Api.PhysicsUrl + "/Config/AuthConfig.xml"
                                                          , arrayStr, model.Code);
            //Action授权
            AuthConfigXmlHelper.UpateActionRolesAuthConfigByXml(Api.PhysicsUrl + "/Config/AuthConfig.xml"
                                                                , model.Code, actionArr);

            return(RedirectToAction("Index", "Role"));
        }