Update AbpIdentityWebMainMenuContributor.cs

pull/1710/head
Alper Ebicoglu 5 years ago
parent 6c54e1acd3
commit d9dc202a54

@ -16,16 +16,18 @@ namespace Volo.Abp.Identity.Web.Navigation
return;
}
var administrationMenu = context.Menu.GetAdministration();
var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>();
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<IdentityResource>>();
var hasRolePermission = await authorizationService.IsGrantedAsync(IdentityPermissions.Roles.Default);
var hasUserPermission = await authorizationService.IsGrantedAsync(IdentityPermissions.Users.Default);
if (hasRolePermission || hasUserPermission)
{
var administrationMenu = context.Menu.GetAdministration();
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<IdentityResource>>();
var identityMenuItem = new ApplicationMenuItem(IdentityMenuNames.GroupName, l["Menu:IdentityManagement"], icon: "fa fa-id-card-o");
administrationMenu.AddItem(identityMenuItem);

Loading…
Cancel
Save