From bc7eb4296f6060635957c844c16f20255942b2ec Mon Sep 17 00:00:00 2001 From: Ahmet Date: Thu, 10 Dec 2020 14:35:41 +0300 Subject: [PATCH] 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 })