增加功能:增加应用程序对登录用户权限认证系统

This commit is contained in:
Argo-Surface 2019-02-25 10:47:05 +08:00
parent 2c009e0255
commit eef7ac7f1c
7 changed files with 13 additions and 6 deletions

View File

@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.1" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.2" />
<PackageReference Include="Longbow.Logging" Version="2.2.5" />
<PackageReference Include="Longbow.Web" Version="2.2.4" />
<PackageReference Include="Microsoft.AspNetCore.App" />

View File

@ -44,6 +44,11 @@ namespace Bootstrap.Admin.Controllers
model.Content = "请求资源未找到";
model.Image = "404_icon.png";
}
else if(id == 403)
{
model.Title = "拒绝响应";
model.Content = "请求资源的访问被服务器拒绝";
}
return View(model);
}
}

View File

@ -1,4 +1,5 @@
using Bootstrap.DataAccess;
using Bootstrap.Security.DataAccess;
using Bootstrap.Security.Filter;
using Longbow.Web;
using Longbow.Web.SignalR;
@ -124,7 +125,7 @@ namespace Bootstrap.Admin
app.UseResponseCompression();
app.UseStaticFiles();
app.UseAuthentication();
app.UseBootstrapAdminAuthorization(userName => RoleHelper.RetrieveRolesByUserName(userName), url => RoleHelper.RetrieveRolesByUrl(url));
app.UseBootstrapAdminAuthorization(RoleHelper.RetrieveRolesByUserName, RoleHelper.RetrieveRolesByUrl, DbHelper.RetrieveAppsByUserName);
app.UseCacheManagerCorsHandler();
app.UseSignalR(routes => { routes.MapHub<SignalRHub>("/NotiHub"); });
app.UseMvc(routes =>

View File

@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="1.7.0" />
<PackageReference Include="Bootstrap.Security.DataAccess" Version="1.8.0" />
<PackageReference Include="Longbow.Cache" Version="2.2.3" />
<PackageReference Include="Longbow.Data" Version="2.2.6" />
<PackageReference Include="Longbow.Web" Version="2.2.4" />

View File

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.1" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.2" />
<PackageReference Include="Longbow.Cache" Version="2.2.3" />
<PackageReference Include="Longbow.Logging" Version="2.2.5" />
<PackageReference Include="Longbow.Web" Version="2.2.4" />

View File

@ -1,4 +1,5 @@
using Bootstrap.Client.DataAccess;
using Bootstrap.Security.DataAccess;
using Bootstrap.Security.Filter;
using Longbow.Web;
using Longbow.Web.SignalR;
@ -83,7 +84,7 @@ namespace Bootstrap.Client
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseAuthentication();
app.UseBootstrapAdminAuthorization(userName => RoleHelper.RetrieveRolesByUserName(userName), url => RoleHelper.RetrieveRolesByUrl(url));
app.UseBootstrapAdminAuthorization(RoleHelper.RetrieveRolesByUserName, RoleHelper.RetrieveRolesByUrl, DbHelper.RetrieveAppsByUserName);
app.UseCacheManagerCorsHandler();
app.UseSignalR(routes => { routes.MapHub<SignalRHub>("/NotiHub"); });
app.UseMvc(routes =>

View File

@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="1.7.0" />
<PackageReference Include="Bootstrap.Security.DataAccess" Version="1.8.0" />
<PackageReference Include="Longbow.Data" Version="2.2.6" />
<PackageReference Include="Longbow.Security.Cryptography" Version="1.3.0" />
<PackageReference Include="Longbow.Web" Version="2.2.4" />