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 d2758f05d4..4658f44013 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 @@ -1,11 +1,14 @@ @page +@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout +@using Volo.Abp.Identity @using Volo.Abp.Identity.Localization @using Volo.Abp.Identity.Web.Navigation @using Volo.Abp.Identity.Web.Pages.Identity.Roles @model IndexModel @inject IHtmlLocalizer L +@inject IAuthorizationService Authorization @inject IPageLayout PageLayout @{ PageLayout.Content.Title = L["Roles"].Value; @@ -30,7 +33,10 @@ @L["Roles"] - + @if (await Authorization.IsGrantedAsync(IdentityPermissions.Roles.Create)) + { + + } 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 b5db7642ba..22e17f7c86 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 @@ -1,11 +1,14 @@ @page +@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout +@using Volo.Abp.TenantManagement @using Volo.Abp.TenantManagement.Localization @using Volo.Abp.TenantManagement.Web.Navigation @using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants @model IndexModel @inject IHtmlLocalizer L +@inject IAuthorizationService Authorization @inject IPageLayout PageLayout @{ PageLayout.Content.Title = L["Tenants"].Value; @@ -26,7 +29,10 @@ @L["Tenants"] - + @if (await Authorization.IsGrantedAsync(TenantManagementPermissions.Tenants.Create)) + { + + } diff --git a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html index 887c16042c..71a694d099 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html +++ b/npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html @@ -4,7 +4,13 @@
-
@@ -76,11 +82,24 @@ {{ 'AbpIdentity::Actions' | abpLocalization }}
- - + -
diff --git a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html index 7778ca8885..507f3cfd06 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html +++ b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.html @@ -87,11 +87,25 @@ {{ 'AbpIdentity::Actions' | abpLocalization }}
- - + -
diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Pages/ProductManagement/Products/index.js b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Pages/ProductManagement/Products/index.js index 2359310a5e..78fec06ba9 100644 --- a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Pages/ProductManagement/Products/index.js +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Pages/ProductManagement/Products/index.js @@ -20,9 +20,7 @@ [ { text: l('Edit'), - visible: function () { - return true; //TODO: Check permission - }, + visible: abp.auth.isGranted('ProductManagement.Product.Update'), action: function (data) { _editModal.open({ productId: data.record.id @@ -31,9 +29,7 @@ }, { text: l('Delete'), - visible: function () { - return true; //TODO: Check permission - }, + visible: abp.auth.isGranted('ProductManagement.Product.Delete'), confirmMessage: function (data) { return l('ProductDeletionWarningMessage'); }, action: function (data) { productManagement.products