调整角色如果不选栏目,默认拥有全部栏目权限
This commit is contained in:
@@ -216,8 +216,11 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
{
|
||||
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 (aclist.Count > 0)
|
||||
{
|
||||
ex &= Product._.KId.In(aclist);
|
||||
}
|
||||
|
||||
//仅显示有权限内容
|
||||
if (my.Roles.OnlyEditMyselfProduct == 1)
|
||||
ex &= Product._.AuthorId == my.Id;
|
||||
@@ -312,13 +315,15 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
{
|
||||
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)
|
||||
if (aclist.Count > 0)
|
||||
{
|
||||
tip.Message = "当前选择栏目不存在,或者您没这个栏目的权限!";
|
||||
return Json(tip);
|
||||
if (aclist.FindIndex(x => x == model.KId) == -1)
|
||||
{
|
||||
tip.Message = "当前选择栏目不存在,或者您没这个栏目的权限!";
|
||||
return Json(tip);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//处理商品更多图片
|
||||
@@ -417,12 +422,13 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
{
|
||||
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)
|
||||
if (aclist.Count > 0)
|
||||
{
|
||||
tip.Message = "当前选择栏目不存在,或者您没这个栏目的权限!";
|
||||
return Json(tip);
|
||||
if (aclist.FindIndex(x => x == model.KId) == -1)
|
||||
{
|
||||
tip.Message = "当前选择栏目不存在,或者您没这个栏目的权限!";
|
||||
return Json(tip);
|
||||
}
|
||||
}
|
||||
|
||||
if (my.Roles.OnlyEditMyselfProduct == 1 && entity.AuthorId != my.Id)
|
||||
@@ -497,14 +503,15 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
{
|
||||
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)
|
||||
if (aclist.Count > 0)
|
||||
{
|
||||
tip.Message = "者您没这个栏目的权限,无法删除该栏目商品!";
|
||||
return Json(tip);
|
||||
if (aclist.FindIndex(x => x == entity.KId) == -1)
|
||||
{
|
||||
tip.Message = "者您没这个栏目的权限,无法删除该栏目商品!";
|
||||
return Json(tip);
|
||||
}
|
||||
}
|
||||
|
||||
if (my.Roles.OnlyEditMyselfArticle == 1 && entity.AuthorId != my.Id)
|
||||
{
|
||||
tip.Message = "系统限制,您无法删除非自己添加的商品!";
|
||||
|
||||
Reference in New Issue
Block a user