I have carried out the steps correctly as per the PhoneBook application. My Record entity has exactly same fields as Person. As per other similar thread on this blog , i have cleared the history, Disabled the cache etc. , bit still the Records link does not show up in the admin role settings page. Please review and help.
AppAuthorizationProvider class: pages.CreateChildPermission(AppPermissions.Pages_Tenant_Records, L("Records"), multiTenancySides: MultiTenancySides.Tenant);
AppPermissions.cs : public const string Pages_Tenant_Records = "Pages.Tenant.Records";
ABPAUTHORIZE ATTRIBUTE :
[AbpAuthorize(AppPermissions.Pages_Tenant_Records)] public class RecordAppService :C2CAppServiceBase, IRecordAppService {}
AppNavigationProvider .cs :
.AddItem(new MenuItemDefinition(
PageNames.App.Tenant.Records,
L("Records"),
url: "tenant.records",
icon: "icon-grid"
requiredPermissionName: AppPermissions.Pages_Tenant_Records
)
App.js :
if (abp.auth.hasPermission('Pages.Tenant.Records')) { $stateProvider.state('tenant.records', { url: '/records', templateUrl: '~/App/tenant/views/Records/index.cshtml', menu: 'Records' }); }
I seem to be doing everything ok, and there is no error , but the permission does not show up under Tenants.
3 Answer(s)
-
0
Hi,
You've 2 problems in the code.
- pages.CreateChildPermission(AppPermissions.Pages_Tenant_Records, L("Records"), multiTenancySides: MultiTenancySides.Tenant);
should be
pages.CreateChildPermission(AppPermissions.Pages_Tenant_Records, L("Records"), multiTenancySides: MultiTenancySides.Host);
Because, as I understand, this page will be seen in the HOST side, not in TENANT side, right?
- You added permission as children of pages (so, as a root permission). If you want to show it under Tenants page, you should add it as a child permission of tenants like here: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/dev/src/MyCompanyName.AbpZeroTemplate.Core/Authorization/AppAuthorizationProvider.cs#L73">https://github.com/aspnetzero/aspnet-ze ... der.cs#L73</a>
-
0
-
0
OK, then it seems you did it right. Only problem I can think is browser caching of scripts. Is your browser's caching disabled?