Пример #1
0
        public ActionResult Save(ResourceDto model)
        {
            var saveState = BusinessHelper.BuildSaveState(Request);

            var operationList = Request["OperationList"];

            var array = BusinessHelper.BreakUpStr(operationList, ',');

            _resourceBll.HttpPostSave(model, saveState, array);

            var info = new AuthConfig
            {
                ControllerName = model.ControllerName,
                ResourceId     = model.ResourceId,
                ResourceUrl    = model.ResourceUrl,
                Roles          = ""
            };

            if (saveState.OperationState == OperationState.Add)
            {
                AuthConfigXmlHelper.AttachAuthConfigByXml(Api.PhysicsUrl + "/Config/AuthConfig.xml"
                                                          , info);
            }
            else
            {
                AuthConfigXmlHelper.UpateResourceAuthConfigByXml(Api.PhysicsUrl + "/Config/AuthConfig.xml"
                                                                 , info);
            }

            return(RedirectToAction("Index", "Resource"));
        }
Пример #2
0
        public ActionResult Save(ModelDto model)
        {
            var saveState = BusinessHelper.BuildSaveState(Request);

            var modelFieldList = Request["ModelFieldList"];

            var array = BusinessHelper.BreakUpStr(modelFieldList, ',');

            _modelBll.HttpPostSave(model, saveState, array);

            return(RedirectToAction("Index", "Model"));
        }
Пример #3
0
        public ActionResult Save(UserDto model)
        {
            var saveState = BusinessHelper.BuildSaveState(Request);

            var roleList = Request["roleList"];

            var array = BusinessHelper.BreakUpStr(roleList, ',');

            _userBll.HttpPostSave(model, saveState, array);

            return(RedirectToAction("Index", "User"));
        }
Пример #4
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"));
        }