管理组管理增加控制普通管理组的文章和商品权限,文章、商品操作增加权限判断
This commit is contained in:
@@ -314,7 +314,20 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
numPerPage = limit;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
Expression ex = Article._.Id > 0;
|
||||
Expression ex = new Expression(); ;
|
||||
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
aclist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<int>>(string.IsNullOrEmpty(my.Roles.AuthorizedArticleCagegory)?"[]": my.Roles.AuthorizedArticleCagegory);
|
||||
if (aclist == null) aclist = new List<int>();
|
||||
if (aclist.Count == 0) aclist.Add(0);
|
||||
ex &= Article._.KId.In(aclist);
|
||||
//仅显示有权限内容
|
||||
if (my.Roles.OnlyEditMyselfArticle == 1)
|
||||
ex &= Article._.AuthorId == my.Id;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(keyword))
|
||||
{
|
||||
@@ -401,6 +414,22 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
tip.Message = "静态化文件名错误,请填写正确的,或者留空!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
aclist = JsonConvert.DeserializeObject<List<int>>(string.IsNullOrEmpty(my.Roles.AuthorizedArticleCagegory) ? "[]" : my.Roles.AuthorizedArticleCagegory);
|
||||
if (aclist == null) aclist = new List<int>();
|
||||
if (aclist.Count == 0) aclist.Add(0);
|
||||
|
||||
if (aclist.FindIndex(x => x == model.KId) == -1)
|
||||
{
|
||||
tip.Message = "当前选择栏目不存在,或者您没这个栏目的权限!";
|
||||
return Json(tip);
|
||||
}
|
||||
}
|
||||
|
||||
//处理文章更多图片
|
||||
string[] moreImgSrc = Request.Form["nImgUrl"];
|
||||
string morIMG = string.Empty;//更多图片的时候用到
|
||||
@@ -421,7 +450,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
model.Content = content;
|
||||
}
|
||||
model.ItemImg = morIMG;
|
||||
model.AuthorId = Core.Admin.GetMyInfo().Id;
|
||||
model.AuthorId = my.Id;
|
||||
model.Insert();
|
||||
ArticleCategory.UpdateDetailCount(model.KId);
|
||||
SessionHelper.WriteSession("com_add_article_kid", model.KId);
|
||||
@@ -490,6 +519,28 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
tip.Message = "静态化文件名错误,请填写正确的,或者留空!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
aclist = JsonConvert.DeserializeObject<List<int>>(string.IsNullOrEmpty(my.Roles.AuthorizedArticleCagegory) ? "[]" : my.Roles.AuthorizedArticleCagegory);
|
||||
if (aclist == null) aclist = new List<int>();
|
||||
if (aclist.Count == 0) aclist.Add(0);
|
||||
|
||||
if (aclist.FindIndex(x => x == model.KId) == -1)
|
||||
{
|
||||
tip.Message = "当前选择栏目不存在,或者您没这个栏目的权限!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
if(my.Roles.OnlyEditMyselfArticle ==1 && entity.AuthorId != my.Id)
|
||||
{
|
||||
tip.Message = "系统限制,您无法编辑非自己添加的文章!";
|
||||
return Json(tip);
|
||||
}
|
||||
}
|
||||
|
||||
//处理文章更多图片
|
||||
string[] moreImgSrc = Request.Form["nImgUrl"];
|
||||
string morIMG = string.Empty;//更多图片的时候用到
|
||||
@@ -580,6 +631,28 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
tip.Message = "系统找不到本文章!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
aclist = JsonConvert.DeserializeObject<List<int>>(string.IsNullOrEmpty(my.Roles.AuthorizedArticleCagegory) ? "[]" : my.Roles.AuthorizedArticleCagegory);
|
||||
if (aclist == null) aclist = new List<int>();
|
||||
if (aclist.Count == 0) aclist.Add(0);
|
||||
|
||||
if (aclist.FindIndex(x => x == entity.KId) == -1)
|
||||
{
|
||||
tip.Message = "者您没这个栏目的权限,无法删除该栏目文章!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
if (my.Roles.OnlyEditMyselfArticle == 1 && entity.AuthorId != my.Id)
|
||||
{
|
||||
tip.Message = "系统限制,您无法删除非自己添加的文章!";
|
||||
return Json(tip);
|
||||
}
|
||||
}
|
||||
|
||||
int kid = entity.Id;
|
||||
//删除TAG
|
||||
//Tag.DeleteTag(RTType.RatuoModule.Article, entity.Id);
|
||||
|
||||
@@ -131,7 +131,14 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
//获取所有的菜单列表
|
||||
IList<AdminMenu> list = AdminMenu.GetListTree(0, -1, false, false);
|
||||
ViewBag.MenuList = list;
|
||||
Core.Admin.WriteLogActions("查看添加管理页面;");
|
||||
//获取所有文章 商品栏目
|
||||
IList<ArticleCategory> aclist = ArticleCategory.GetListTree(0, -1, true, true);
|
||||
ViewBag.aclist = aclist;
|
||||
|
||||
IList<Category> pclist = Category.GetListTree(0, -1, true, true);
|
||||
ViewBag.pclist = pclist;
|
||||
|
||||
Core.Admin.WriteLogActions("查看添加管理组页面;");
|
||||
return View();
|
||||
}
|
||||
//执行添加管理组
|
||||
@@ -143,6 +150,13 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
string RoleDescription = fc["RoleDescription"];
|
||||
string IsSuperAdmin = fc["IsSuperAdmin"];
|
||||
string NotAllowDel = fc["NotAllowDel"];
|
||||
string OnlyEditMyselfArticle = fc["OnlyEditMyselfArticle"];
|
||||
string OnlyEditMyselfProduct = fc["OnlyEditMyselfProduct"];
|
||||
|
||||
if (string.IsNullOrEmpty(OnlyEditMyselfArticle) || !Utils.IsInt(OnlyEditMyselfProduct)) OnlyEditMyselfProduct = "0";
|
||||
if (string.IsNullOrEmpty(OnlyEditMyselfProduct) || !Utils.IsInt(OnlyEditMyselfProduct)) OnlyEditMyselfProduct = "0";
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(RoleName))
|
||||
{
|
||||
tip.Message = "管理组名称不能为空!";
|
||||
@@ -155,6 +169,8 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
entity.RoleDescription = RoleDescription;
|
||||
entity.IsSuperAdmin = int.Parse(IsSuperAdmin);
|
||||
entity.NotAllowDel = !string.IsNullOrEmpty(NotAllowDel) && NotAllowDel == "1" ? 1 : 0;
|
||||
entity.OnlyEditMyselfArticle = int.Parse(OnlyEditMyselfArticle);
|
||||
entity.OnlyEditMyselfProduct = int.Parse(OnlyEditMyselfProduct);
|
||||
|
||||
//处理权限
|
||||
if (entity.IsSuperAdmin == 1)
|
||||
@@ -208,6 +224,30 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
//处理文章和商品栏目权限
|
||||
string[] acpower = Request.Form["acpower"];
|
||||
string[] pcpower = Request.Form["pcpower"];
|
||||
|
||||
List<int> acids = new List<int>();
|
||||
List<int> pcids = new List<int>();
|
||||
foreach (var item in acpower)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item) && Utils.IsInt(item))
|
||||
{
|
||||
acids.Add(int.Parse(item));
|
||||
}
|
||||
}
|
||||
foreach (var item in pcpower)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item) && Utils.IsInt(item))
|
||||
{
|
||||
pcids.Add(int.Parse(item));
|
||||
}
|
||||
}
|
||||
|
||||
entity.AuthorizedArticleCagegory = JsonConvert.SerializeObject(acids);
|
||||
entity.AuthorizedCagegory = JsonConvert.SerializeObject(pcids);
|
||||
|
||||
entity.Insert();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "添加管理组成功";
|
||||
@@ -230,8 +270,20 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
entity.Powers = "[]";
|
||||
if (string.IsNullOrEmpty(entity.Menus))
|
||||
entity.Menus = "[]";
|
||||
if (string.IsNullOrEmpty(entity.AuthorizedArticleCagegory))
|
||||
entity.AuthorizedArticleCagegory = "[]";
|
||||
if (string.IsNullOrEmpty(entity.AuthorizedCagegory))
|
||||
entity.AuthorizedCagegory = "[]";
|
||||
//获取所有的菜单列表
|
||||
IList<AdminMenu> list = AdminMenu.GetListTree(0, -1, false, false);
|
||||
|
||||
//获取所有文章 商品栏目
|
||||
IList<ArticleCategory> aclist = ArticleCategory.GetListTree(0, -1, true, true);
|
||||
ViewBag.aclist = aclist;
|
||||
|
||||
IList<Category> pclist = Category.GetListTree(0, -1, true, true);
|
||||
ViewBag.pclist = pclist;
|
||||
|
||||
ViewBag.MenuList = list;
|
||||
Core.Admin.WriteLogActions($"查看管理组({id})详情;");
|
||||
return View(entity);
|
||||
@@ -246,6 +298,12 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
string RoleDescription = fc["RoleDescription"];
|
||||
string IsSuperAdmin = fc["IsSuperAdmin"];
|
||||
string NotAllowDel = fc["NotAllowDel"];
|
||||
string OnlyEditMyselfArticle = fc["OnlyEditMyselfArticle"];
|
||||
string OnlyEditMyselfProduct = fc["OnlyEditMyselfProduct"];
|
||||
|
||||
if (string.IsNullOrEmpty(OnlyEditMyselfArticle) || !Utils.IsInt(OnlyEditMyselfProduct)) OnlyEditMyselfProduct = "0";
|
||||
if (string.IsNullOrEmpty(OnlyEditMyselfProduct) || !Utils.IsInt(OnlyEditMyselfProduct)) OnlyEditMyselfProduct = "0";
|
||||
|
||||
if (string.IsNullOrEmpty(Id))
|
||||
{
|
||||
tip.Message = "错误参数传递!";
|
||||
@@ -268,6 +326,8 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
entity.RoleDescription = RoleDescription;
|
||||
entity.IsSuperAdmin = int.Parse(IsSuperAdmin);
|
||||
entity.NotAllowDel = !string.IsNullOrEmpty(NotAllowDel) && NotAllowDel == "1" ? 1 : 0;
|
||||
entity.OnlyEditMyselfArticle = int.Parse(OnlyEditMyselfArticle);
|
||||
entity.OnlyEditMyselfProduct = int.Parse(OnlyEditMyselfProduct);
|
||||
|
||||
//处理权限
|
||||
if (entity.IsSuperAdmin == 1)
|
||||
@@ -320,6 +380,31 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//处理文章和商品栏目权限
|
||||
string[] acpower = Request.Form["acpower"];
|
||||
string[] pcpower = Request.Form["pcpower"];
|
||||
|
||||
List<int> acids = new List<int>();
|
||||
List<int> pcids = new List<int>();
|
||||
foreach (var item in acpower)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item) && Utils.IsInt(item))
|
||||
{
|
||||
acids.Add(int.Parse(item));
|
||||
}
|
||||
}
|
||||
foreach (var item in pcpower)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item) && Utils.IsInt(item))
|
||||
{
|
||||
pcids.Add(int.Parse(item));
|
||||
}
|
||||
}
|
||||
|
||||
entity.AuthorizedArticleCagegory = JsonConvert.SerializeObject(acids);
|
||||
entity.AuthorizedCagegory = JsonConvert.SerializeObject(pcids);
|
||||
|
||||
entity.Update();
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
tip.Message = "编辑管理组详情成功";
|
||||
|
||||
@@ -208,7 +208,20 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
numPerPage = limit;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
Expression ex = Product._.Id > 0;
|
||||
Expression ex = new Expression();
|
||||
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
aclist = JsonConvert.DeserializeObject<List<int>>(string.IsNullOrEmpty(my.Roles.AuthorizedCagegory) ? "[]" : my.Roles.AuthorizedCagegory);
|
||||
if (aclist == null) aclist = new List<int>();
|
||||
if (aclist.Count == 0) aclist.Add(0);
|
||||
ex &= Product._.KId.In(aclist);
|
||||
//仅显示有权限内容
|
||||
if (my.Roles.OnlyEditMyselfProduct == 1)
|
||||
ex &= Product._.AuthorId == my.Id;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(keyword))
|
||||
{
|
||||
@@ -292,6 +305,22 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
tip.Message = "商品图片填写的不是图片格式!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
aclist = JsonConvert.DeserializeObject<List<int>>(string.IsNullOrEmpty(my.Roles.AuthorizedCagegory)?"[]": my.Roles.AuthorizedCagegory);
|
||||
if (aclist == null) aclist = new List<int>();
|
||||
if (aclist.Count == 0) aclist.Add(0);
|
||||
|
||||
if (aclist.FindIndex(x => x == model.KId) == -1)
|
||||
{
|
||||
tip.Message = "当前选择栏目不存在,或者您没这个栏目的权限!";
|
||||
return Json(tip);
|
||||
}
|
||||
}
|
||||
|
||||
//处理商品更多图片
|
||||
string[] moreImgSrc = Request.Form["nImgUrl"];
|
||||
string morIMG = string.Empty;//更多图片的时候用到
|
||||
@@ -312,7 +341,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
model.Content = content;
|
||||
}
|
||||
model.ItemImg = morIMG;
|
||||
model.AuthorId = Core.Admin.GetMyInfo().Id;
|
||||
model.AuthorId = my.Id;
|
||||
model.Insert();
|
||||
Category.UpdateDetailCount(model.KId);
|
||||
//添加TAG
|
||||
@@ -381,6 +410,28 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
tip.Message = "商品图片填写的不是图片格式!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
aclist = JsonConvert.DeserializeObject<List<int>>(string.IsNullOrEmpty(my.Roles.AuthorizedCagegory) ? "[]" : my.Roles.AuthorizedCagegory);
|
||||
if (aclist == null) aclist = new List<int>();
|
||||
if (aclist.Count == 0) aclist.Add(0);
|
||||
|
||||
if (aclist.FindIndex(x => x == model.KId) == -1)
|
||||
{
|
||||
tip.Message = "当前选择栏目不存在,或者您没这个栏目的权限!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
if (my.Roles.OnlyEditMyselfProduct == 1 && entity.AuthorId != my.Id)
|
||||
{
|
||||
tip.Message = "系统限制,您无法编辑非自己添加的商品!";
|
||||
return Json(tip);
|
||||
}
|
||||
}
|
||||
|
||||
//处理商品更多图片
|
||||
string[] moreImgSrc = Request.Form["nImgUrl"];
|
||||
string morIMG = string.Empty;//更多图片的时候用到
|
||||
@@ -439,6 +490,28 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
tip.Message = "系统找不到本商品!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
aclist = JsonConvert.DeserializeObject<List<int>>(string.IsNullOrEmpty(my.Roles.AuthorizedCagegory) ? "[]" : my.Roles.AuthorizedCagegory);
|
||||
if (aclist == null) aclist = new List<int>();
|
||||
if (aclist.Count == 0) aclist.Add(0);
|
||||
|
||||
if (aclist.FindIndex(x => x == entity.KId) == -1)
|
||||
{
|
||||
tip.Message = "者您没这个栏目的权限,无法删除该栏目商品!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
if (my.Roles.OnlyEditMyselfArticle == 1 && entity.AuthorId != my.Id)
|
||||
{
|
||||
tip.Message = "系统限制,您无法删除非自己添加的商品!";
|
||||
return Json(tip);
|
||||
}
|
||||
}
|
||||
|
||||
int kid = entity.KId;
|
||||
//删除TAG
|
||||
//Tag.DeleteTag(RTType.RatuoModule.Article, entity.Id);
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
|
||||
@{
|
||||
ViewBag.title = "添加文章";
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1 && !string.IsNullOrEmpty(my.Roles.AuthorizedArticleCagegory))
|
||||
{
|
||||
aclist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<int>>(my.Roles.AuthorizedArticleCagegory);
|
||||
}
|
||||
}
|
||||
|
||||
<div class="wrapper wrapper-content ">
|
||||
@@ -18,7 +24,17 @@
|
||||
<select class="form-control m-b" name="KId" id="KId">
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
if (aclist.FindIndex(x => x == m.Id) > -1)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -41,17 +41,20 @@
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
</button>
|
||||
}
|
||||
<button id="btn_edit" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addarticle','批量迁移文章','/AdminCP/Article/MoveArticle',0,0)">
|
||||
<span class="glyphicon glyphicon-move" aria-hidden="true"></span> 文章迁移
|
||||
</button>
|
||||
<button id="btn_delete" type="button" class="btn btn-outline btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
批量处理 <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-left">
|
||||
<li><a href="javascript:;" onclick="doBatchAction('/AdminCP/Article/DoBatchHideArticle','隐藏')"><i class="fa fa-eye-slash"></i> 批量隐藏</a></li>
|
||||
<li><a href="javascript:;" onclick="doBatchAction('/AdminCP/Article/DoBatchShowArticle','显示')"><i class="fa fa-eye"></i> 批量显示</a></li>
|
||||
<li><a href="javascript:;" onclick="doBatchAction('/AdminCP/Article/DoBatchDelArticle','删除')"><i class="fa fa-close"></i> 批量删除</a></li>
|
||||
</ul>
|
||||
@if (AdminUtils.CheckAdminPower("batch", "article"))
|
||||
{
|
||||
<button id="btn_edit" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addarticle','批量迁移文章','/AdminCP/Article/MoveArticle',0,0)">
|
||||
<span class="glyphicon glyphicon-move" aria-hidden="true"></span> 文章迁移
|
||||
</button>
|
||||
<button id="btn_delete" type="button" class="btn btn-outline btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
批量处理 <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-left">
|
||||
<li><a href="javascript:;" onclick="doBatchAction('/AdminCP/Article/DoBatchHideArticle','隐藏')"><i class="fa fa-eye-slash"></i> 批量隐藏</a></li>
|
||||
<li><a href="javascript:;" onclick="doBatchAction('/AdminCP/Article/DoBatchShowArticle','显示')"><i class="fa fa-eye"></i> 批量显示</a></li>
|
||||
<li><a href="javascript:;" onclick="doBatchAction('/AdminCP/Article/DoBatchDelArticle','删除')"><i class="fa fa-close"></i> 批量删除</a></li>
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
<table id="tb_departments"></table>
|
||||
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
@model COMCMS.Core.Article
|
||||
@{
|
||||
ViewBag.title = "查看/编辑文章详情";
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1 && !string.IsNullOrEmpty(my.Roles.AuthorizedArticleCagegory))
|
||||
{
|
||||
aclist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<int>>(my.Roles.AuthorizedArticleCagegory);
|
||||
}
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
@@ -18,7 +24,14 @@
|
||||
<select class="form-control m-b" asp-for="KId">
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
if (aclist.FindIndex(x => x == m.Id) > -1)
|
||||
{
|
||||
<option value="@m.Id" selected>@m.KindName</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
@{
|
||||
ViewBag.title = "批量迁移文章";
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1 && !string.IsNullOrEmpty(my.Roles.AuthorizedArticleCagegory))
|
||||
{
|
||||
aclist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<int>>(my.Roles.AuthorizedArticleCagegory);
|
||||
}
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
@@ -20,7 +26,17 @@
|
||||
<select class="form-control m-b" name="from" id="from">
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
if (aclist.FindIndex(x => x == m.Id) > -1)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
<li class="">
|
||||
<a data-toggle="tab" href="#tab-2" aria-expanded="false"> 管理组权限设置</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a data-toggle="tab" href="#tab-3" aria-expanded="false"> 授权文章、商品权限</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-1" class="tab-pane active">
|
||||
@@ -99,12 +102,60 @@
|
||||
}
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.tree').treegrid();
|
||||
});
|
||||
$(document).ready(function () {
|
||||
$('.tree').treegrid();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tab-3" class="tab-pane">
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info">
|
||||
温馨提示:如果选择『超级管理员』级别,则默认拥有所有权限,不需要选择。普通管理员需要赋予菜单权限方可生效。按ctrl或者shift多选
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">限制文章权限:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" id="OnlyEditMyselfArticle" name="OnlyEditMyselfArticle">
|
||||
<option value="0">可以操作所有授权栏目文章</option>
|
||||
<option value="1">仅能操作所有授权栏目自己添加的文章</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">文章权限:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" id="acpower" name="acpower" multiple style="height:260px">
|
||||
@foreach (ArticleCategory m in ViewBag.aclist)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">限制商品权限:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" id="OnlyEditMyselfProduct" name="OnlyEditMyselfProduct">
|
||||
<option value="0">可以操作所有授权栏目商品</option>
|
||||
<option value="1">仅能操作所有授权栏目自己添加的商品</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品权限:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" id="pcpower" name="pcpower" multiple style="height:260px">
|
||||
@foreach (Category m in ViewBag.pclist)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
@model AdminRoles
|
||||
@{
|
||||
ViewBag.title = "查看/编辑管理组详情";
|
||||
List<int> aclist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<int>>(Model.AuthorizedArticleCagegory);
|
||||
List<int> pclist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<int>>(Model.AuthorizedCagegory);
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
@@ -20,6 +22,9 @@
|
||||
<li class="">
|
||||
<a data-toggle="tab" href="#tab-2" aria-expanded="false"> 管理组权限设置</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a data-toggle="tab" href="#tab-3" aria-expanded="false"> 授权文章、商品权限</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-1" class="tab-pane active">
|
||||
@@ -105,6 +110,69 @@
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tab-3" class="tab-pane">
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info">
|
||||
温馨提示:如果选择『超级管理员』级别,则默认拥有所有权限,不需要选择。普通管理员需要赋予菜单权限方可生效。按ctrl或者shift多选
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">限制文章权限:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" asp-for="OnlyEditMyselfArticle">
|
||||
<option value="0">可以操作所有授权栏目文章</option>
|
||||
<option value="1">仅能操作所有授权栏目自己添加的文章</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">文章权限:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" id="acpower" name="acpower" multiple style="height:260px">
|
||||
@foreach (ArticleCategory m in ViewBag.aclist)
|
||||
{
|
||||
if (aclist.FindIndex(x => x == m.Id) > -1)
|
||||
{
|
||||
<option value="@m.Id" selected>@m.KindName</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">限制商品权限:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" asp-for="OnlyEditMyselfProduct">
|
||||
<option value="0">可以操作所有授权栏目商品</option>
|
||||
<option value="1">仅能操作所有授权栏目自己添加的商品</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商品权限:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" id="pcpower" name="pcpower" multiple style="height:260px">
|
||||
@foreach (Category m in ViewBag.pclist)
|
||||
{
|
||||
if (pclist.FindIndex(x => x == m.Id) > -1)
|
||||
{
|
||||
<option value="@m.Id" selected>@m.KindName</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -134,7 +202,7 @@
|
||||
});
|
||||
powers.map(function(item){
|
||||
$("#"+item.MenuKey+"_"+item.Id).prop("checked","checked");
|
||||
console.log("#"+item.MenuKey+"_"+item.Id);
|
||||
//console.log("#"+item.MenuKey+"_"+item.Id);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
@model COMCMS.Core.Product
|
||||
@{
|
||||
ViewBag.title = "添加商品详情";
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1 && !string.IsNullOrEmpty(my.Roles.AuthorizedCagegory))
|
||||
{
|
||||
aclist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<int>>(my.Roles.AuthorizedCagegory);
|
||||
}
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
@@ -18,7 +24,17 @@
|
||||
<select class="form-control m-b" name="KId" id="KId">
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
if (aclist.FindIndex(x => x == m.Id) > -1)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
@model COMCMS.Core.Product
|
||||
@{
|
||||
ViewBag.title = "编辑商品详情";
|
||||
Admin my = Admin.GetMyInfo();
|
||||
List<int> aclist = new List<int>();
|
||||
if (my.Roles.IsSuperAdmin != 1 && !string.IsNullOrEmpty(my.Roles.AuthorizedCagegory))
|
||||
{
|
||||
aclist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<int>>(my.Roles.AuthorizedCagegory);
|
||||
}
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
@@ -18,7 +24,17 @@
|
||||
<select class="form-control m-b" asp-for="KId">
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
if (my.Roles.IsSuperAdmin != 1)
|
||||
{
|
||||
if (aclist.FindIndex(x => x == m.Id) > -1)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user