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")); }
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")); }
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")); }
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")); }