refactor: 更新按钮授权方法

This commit is contained in:
Argo Zhang 2019-09-06 12:39:13 +08:00
parent 9043a6d155
commit db4b48e1c3
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
4 changed files with 16 additions and 3 deletions

View File

@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.13" />
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.14" />
<PackageReference Include="Longbow.Data" Version="2.3.7" />
<PackageReference Include="Longbow.Logging" Version="2.2.13" />
<PackageReference Include="Longbow.PetaPoco" Version="1.0.2" />

View File

@ -133,6 +133,6 @@ namespace Bootstrap.DataAccess
/// <param name="url">资源按钮所属菜单</param>
/// <param name="auths">资源授权码</param>
/// <returns></returns>
public static bool AuthorizateButtons(string userName, string url, string auths) => DbHelper.AuthorizateButtons(userName, url, auths);
public static bool AuthorizateButtons(string userName, string url, string auths) => DbContextManager.Create<Menu>().AuthorizateButtons(userName, url, auths);
}
}

View File

@ -97,5 +97,18 @@ namespace Bootstrap.DataAccess
/// <param name="userName">当前登录的用户名</param>
/// <returns></returns>
public virtual IEnumerable<BootstrapMenu> RetrieveAllMenus(string userName) => DbHelper.RetrieveAllMenus(userName);
/// <summary>
/// 通过当前用户名与指定菜单路径获取此菜单下所有授权按钮集合 (userName, url, auths) => bool
/// </summary>
/// <param name="userName">当前操作用户名</param>
/// <param name="url">资源按钮所属菜单</param>
/// <param name="auths">资源授权码</param>
/// <returns></returns>
public virtual bool AuthorizateButtons(string userName, string url, string auths)
{
var menus = MenuHelper.RetrieveAllMenus(userName);
return DbHelper.AuthorizateButtons(menus, url, auths);
}
}
}

View File

@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.13" />
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.14" />
<PackageReference Include="Longbow.Cache" Version="2.2.15" />
<PackageReference Include="Longbow.Configuration" Version="2.2.7" />
<PackageReference Include="Longbow.Data" Version="2.3.7" />