v1.1 实现用户分级授权,得到权限的用户只能在自己的权限范围内再进一步操作

This commit is contained in:
yubaolee
2016-05-27 00:58:36 +08:00
parent ef6a274ac6
commit fbdd6163a2
10 changed files with 174 additions and 131 deletions

View File

@@ -30,11 +30,11 @@ namespace OpenAuth.Mvc
{
var builder = new ContainerBuilder();
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>
//注册数据库基础操作和工作单元
builder.RegisterGeneric(typeof(BaseRepository<>)).As(typeof(IRepository<>));
builder.RegisterType(typeof (UnitWork)).As(typeof (IUnitWork));
//Ӧ<EFBFBD>ò<EFBFBD>ע<EFBFBD><EFBFBD>
//注册WebConfig中的配置
builder.RegisterModule(new ConfigurationSettingsReader("autofac"));
//注册app层

View File

@@ -46,7 +46,7 @@ namespace OpenAuth.Mvc.Controllers
/// </summary>
public string Load(int categoryId, int pageCurrent = 1, int pageSize = 30)
{
return JsonHelper.Instance.Serialize(_app.Load(categoryId, pageCurrent, pageSize));
return JsonHelper.Instance.Serialize(_app.Load(User.Identity.Name, categoryId, pageCurrent, pageSize));
}
public string LoadForTree()
@@ -94,7 +94,7 @@ namespace OpenAuth.Mvc.Controllers
/// <returns>System.String.</returns>
public string LoadWithAccess(int cId, int firstId, string key)
{
return JsonHelper.Instance.Serialize(_app.LoadWithAccess(key,firstId, cId));
return JsonHelper.Instance.Serialize(_app.LoadWithAccess(User.Identity.Name,key,firstId, cId));
}
}
}

View File

@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// 你可以指定所有值,也可以让修订版本和内部版本号采用默认值,
// 方法是按如下所示使用 "*":
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]

View File

@@ -6,7 +6,7 @@
<div class="bjui-pageContent tableContent" style="position: relative">
<div class="clearfix">
<div style="float: left; width: 220px; overflow: auto;" class="table table-bordered">
<ul id="tree" class="ztree"></ul>
<ul id="orgtree" class="ztree"></ul>
</div>
<div id="detail" style="margin-left: 225px;">