调整角色如果不选栏目,默认拥有全部栏目权限
This commit is contained in:
@@ -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>>(string.IsNullOrEmpty(my.Roles.AuthorizedArticleCagegory)?"[]": my.Roles.AuthorizedArticleCagegory);
|
||||
}
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
@@ -21,7 +27,17 @@
|
||||
<option value="0">所有栏目</option>
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
if (my.Roles.IsSuperAdmin != 1 && aclist.Count>0)
|
||||
{
|
||||
if (aclist.FindIndex(x => x == m.Id) > -1)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label class="checkbox-inline i-checks">
|
||||
|
||||
Reference in New Issue
Block a user