From 0402423b64407cde0979d69d53fb2164c3b4dbe8 Mon Sep 17 00:00:00 2001 From: Ahmet Date: Thu, 10 Dec 2020 14:32:47 +0300 Subject: [PATCH 1/3] applied on Identity Users --- .../AbpIdentityWebModule.cs | 18 ++++++++++++++++++ .../Pages/Identity/Users/Index.cshtml | 6 ++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs b/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs index ce26e91e20..cc29ee26dd 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs @@ -2,9 +2,11 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.PageToolbars; using Volo.Abp.AutoMapper; using Volo.Abp.Identity.Localization; using Volo.Abp.Identity.Web.Navigation; +using Volo.Abp.Localization; using Volo.Abp.Modularity; using Volo.Abp.ObjectExtending; using Volo.Abp.ObjectExtending.Modularity; @@ -64,6 +66,22 @@ namespace Volo.Abp.Identity.Web options.Conventions.AuthorizePage("/Identity/Roles/CreateModal", IdentityPermissions.Roles.Create); options.Conventions.AuthorizePage("/Identity/Roles/EditModal", IdentityPermissions.Roles.Update); }); + + + Configure(options => + { + options.Configure( + toolbar => + { + toolbar.AddButton( + LocalizableString.Create("NewUser"), + icon: "plus", + name: "CreateUser", + requiredPolicyName: IdentityPermissions.Users.Create + ); + } + ); + }); } public override void PostConfigureServices(ServiceConfigurationContext context) diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml index ee9192d58f..5904cab2fa 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml @@ -2,6 +2,7 @@ @using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageToolbar @using Volo.Abp.Identity @using Volo.Abp.Identity.Localization @using Volo.Abp.Identity.Web.Navigation @@ -34,10 +35,7 @@ @L["Users"] - @if (await Authorization.IsGrantedAsync(IdentityPermissions.Users.Create)) - { - - } + @await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(IndexModel).FullName }) From bc7eb4296f6060635957c844c16f20255942b2ec Mon Sep 17 00:00:00 2001 From: Ahmet Date: Thu, 10 Dec 2020 14:35:41 +0300 Subject: [PATCH 2/3] toolbar applied on Identity Roles --- .../Volo.Abp.Identity.Web/AbpIdentityWebModule.cs | 12 ++++++++++++ .../Pages/Identity/Roles/Index.cshtml | 6 ++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs b/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs index cc29ee26dd..511455bab3 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs @@ -81,6 +81,18 @@ namespace Volo.Abp.Identity.Web ); } ); + + options.Configure( + toolbar => + { + toolbar.AddButton( + LocalizableString.Create("NewRole"), + icon: "plus", + name: "CreateRole", + requiredPolicyName: IdentityPermissions.Roles.Create + ); + } + ); }); } diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml index 734fc40fe5..30e42694e6 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml @@ -2,6 +2,7 @@ @using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageToolbar @using Volo.Abp.Identity @using Volo.Abp.Identity.Localization @using Volo.Abp.Identity.Web.Navigation @@ -33,10 +34,7 @@ @L["Roles"] - @if (await Authorization.IsGrantedAsync(IdentityPermissions.Roles.Create)) - { - - } + @await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(IndexModel).FullName }) From 7438f3b8336c7366044505c66e87d3f3894295db Mon Sep 17 00:00:00 2001 From: Ahmet Date: Thu, 10 Dec 2020 14:43:33 +0300 Subject: [PATCH 3/3] toolbar applied on TenantManagement --- .../AbpTenantManagementWebModule.cs | 24 +++++++++++++++++++ .../TenantManagement/Tenants/Index.cshtml | 10 ++------ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs index e993ea2c63..e03a7ec2a2 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs @@ -2,8 +2,10 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.PageToolbars; using Volo.Abp.AutoMapper; using Volo.Abp.FeatureManagement; +using Volo.Abp.Localization; using Volo.Abp.Modularity; using Volo.Abp.ObjectExtending; using Volo.Abp.ObjectExtending.Modularity; @@ -61,6 +63,28 @@ namespace Volo.Abp.TenantManagement.Web options.Conventions.AuthorizePage("/TenantManagement/Tenants/EditModal", TenantManagementPermissions.Tenants.Update); options.Conventions.AuthorizePage("/TenantManagement/Tenants/ConnectionStrings", TenantManagementPermissions.Tenants.ManageConnectionStrings); }); + + Configure(options => + { + options.Configure( + toolbar => + { + toolbar.AddButton( + LocalizableString.Create("ManageHostFeatures"), + icon: "cog", + name: "ManageHostFeatures", + requiredPolicyName: FeatureManagementPermissions.ManageHostFeatures + ); + + toolbar.AddButton( + LocalizableString.Create("NewTenant"), + icon: "plus", + name: "CreateTenant", + requiredPolicyName: TenantManagementPermissions.Tenants.Create + ); + } + ); + }); } public override void PostConfigureServices(ServiceConfigurationContext context) diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.cshtml b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.cshtml index bb972b02d8..67fd507bcc 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.cshtml +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.cshtml @@ -2,6 +2,7 @@ @using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageToolbar @using Volo.Abp.FeatureManagement @using Volo.Abp.TenantManagement @using Volo.Abp.TenantManagement.Localization @@ -30,14 +31,7 @@ @L["Tenants"] - @if (await Authorization.IsGrantedAsync(FeatureManagementPermissions.ManageHostFeatures)) - { - - } - @if (await Authorization.IsGrantedAsync(TenantManagementPermissions.Tenants.Create)) - { - - } + @await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(IndexModel).FullName })