From 1cb81805c48a8865da605553c29a85ae726a0b25 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Thu, 5 Sep 2019 21:58:20 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=8E=88=E6=9D=83=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj | 2 +- src/admin/Bootstrap.Admin/Startup.cs | 2 +- .../Bootstrap.DataAccess/Bootstrap.DataAccess.csproj | 2 +- src/admin/Bootstrap.DataAccess/Helper/MenuHelper.cs | 9 +++++++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj index 2b6d240a..60ac2062 100644 --- a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj +++ b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/admin/Bootstrap.Admin/Startup.cs b/src/admin/Bootstrap.Admin/Startup.cs index 38ecee6d..22f17b49 100644 --- a/src/admin/Bootstrap.Admin/Startup.cs +++ b/src/admin/Bootstrap.Admin/Startup.cs @@ -62,7 +62,7 @@ namespace Bootstrap.Admin services.AddResponseCompression(); services.AddBootstrapAdminAuthentication(); services.AddSwagger(); - services.AddButtonAuthorization(MenuHelper.RetrieveAllMenus); + services.AddButtonAuthorization(MenuHelper.AuthorizateButtons); services.AddBootstrapAdminBackgroundTask(); services.AddHttpClient(); services.AddAdminHealthChecks(); diff --git a/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj b/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj index 5346c6dd..49abd1aa 100644 --- a/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj +++ b/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/admin/Bootstrap.DataAccess/Helper/MenuHelper.cs b/src/admin/Bootstrap.DataAccess/Helper/MenuHelper.cs index 8ac9075a..d90b0ba5 100644 --- a/src/admin/Bootstrap.DataAccess/Helper/MenuHelper.cs +++ b/src/admin/Bootstrap.DataAccess/Helper/MenuHelper.cs @@ -125,5 +125,14 @@ namespace Bootstrap.DataAccess /// /// public static IEnumerable RetrieveAllMenus(string userName) => CacheManager.GetOrAdd($"{RetrieveMenusAll}-{userName}", key => DbContextManager.Create()?.RetrieveAllMenus(userName), RetrieveMenusAll); + + /// + /// + /// + /// + /// + /// + /// + public static bool AuthorizateButtons(string userName, string url, string auths) => DbHelper.AuthorizateButtons(userName, url, auths); } }