| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using BizCom;
- using System.Web;
- namespace SiteCore.Handler
- {
- public class SetPurview : BaseHandler, IHttpHandler
- {
- public void ProcessRequest(HttpContext context)
- {
- if (context.Request.Form["type"] != null && context.Request.Form["setid"] != null)
- {
- string sType = context.Request.Form["type"].Trim().ToLower();
- string sId = context.Request.Form["setid"].Trim().ToLower();
- string sValue = context.Request.Form["v"].Trim().ToLower();
- try
- {
- switch (sType)
- {
- case "pms":
- {
- //更新权限
- XPermission.SavePermission(sId, "0", sValue);
- WebUser.RemovePermissionCache(sId);
- //返回信息
- Utils.CommonHelper.ReturnJsonMsg("success", "保存成功");
- break;
- }
- case "orgrights":
- {
- //更新权限
- CeErpPermission.SaveOrgPermission(sId, sValue);
- //返回信息
- Utils.CommonHelper.ReturnJsonMsg("success", "保存成功");
- break;
- }
- case "postrights":
- {
- string oId = context.Request.Form["oId"].ToString();
- CeErpPermission.SavePostPermission(sId, oId, sValue);
- WebUser.RemovePermissionCache(sId);
- //返回信息
- Utils.CommonHelper.ReturnJsonMsg("success", "保存成功");
- break;
- }
- }
- }
- catch
- {
- Utils.CommonHelper.ReturnJsonMsg("error", "服务器错误");
- }
- }
- else
- {
- Utils.CommonHelper.ReturnJsonMsg("error", "服务器错误");
- }
- }
- }
- }
|