|
|
|
@ -1,14 +1,11 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.Localization; |
|
|
|
using Volo.Abp.UI.Navigation; |
|
|
|
using Volo.Docs.Localization; |
|
|
|
|
|
|
|
namespace Volo.Docs.Admin |
|
|
|
namespace Volo.Docs.Admin.Navigation |
|
|
|
{ |
|
|
|
public class DocsMenuContributor : IMenuContributor |
|
|
|
{ |
|
|
|
@ -25,17 +22,15 @@ namespace Volo.Docs.Admin |
|
|
|
var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>(); |
|
|
|
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<DocsResource>>(); |
|
|
|
|
|
|
|
//if (await authorizationService.IsGrantedAsync(DocsAdminPermissions.GroupName))
|
|
|
|
{ |
|
|
|
var rootMenuItem = new ApplicationMenuItem("DocumentManagement", l["Menu:DocumentManagement"], "/Docs/Admin"); |
|
|
|
var rootMenuItem = new ApplicationMenuItem(DocsMenuNames.GroupName, l["Menu:DocumentManagement"], icon: "fa fa-book"); |
|
|
|
|
|
|
|
if (await authorizationService.IsGrantedAsync(DocsAdminPermissions.Projects.Default)) |
|
|
|
{ |
|
|
|
rootMenuItem.AddItem(new ApplicationMenuItem("ProjectManagement", l["Menu:ProjectManagement"], "/Docs/Admin/Projects")); |
|
|
|
} |
|
|
|
context.Menu.AddItem(rootMenuItem); |
|
|
|
|
|
|
|
context.Menu.AddItem(rootMenuItem); |
|
|
|
if (await authorizationService.IsGrantedAsync(DocsAdminPermissions.Projects.Default)) |
|
|
|
{ |
|
|
|
rootMenuItem.AddItem(new ApplicationMenuItem(DocsMenuNames.Projects, l["Menu:ProjectManagement"], "/Docs/Admin/Projects")); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |