mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.2 KiB
36 lines
1.2 KiB
using System.Threading.Tasks;
|
|
using Volo.Abp.UI.Navigation;
|
|
using Volo.Blogging.Localization;
|
|
|
|
namespace Volo.Blogging.Admin
|
|
{
|
|
public class BloggingAdminMenuContributor : IMenuContributor
|
|
{
|
|
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
|
|
{
|
|
if (context.Menu.Name == StandardMenus.Main)
|
|
{
|
|
await ConfigureMainMenu(context);
|
|
}
|
|
}
|
|
|
|
private async Task ConfigureMainMenu(MenuConfigurationContext context)
|
|
{
|
|
var l = context.GetLocalizer<BloggingResource>();
|
|
|
|
if (await context.IsGrantedAsync(BloggingPermissions.Blogs.Management))
|
|
{
|
|
var managementRootMenuItem = new ApplicationMenuItem("BlogManagement", l["Menu:BlogManagement"]);
|
|
|
|
//TODO: Using the same permission. Reconsider.
|
|
if (await context.IsGrantedAsync(BloggingPermissions.Blogs.Management))
|
|
{
|
|
managementRootMenuItem.AddItem(new ApplicationMenuItem("BlogManagement.Blogs", l["Menu:Blogs"], "~/Blogging/Admin/Blogs"));
|
|
}
|
|
|
|
context.Menu.GetAdministration().AddItem(managementRootMenuItem);
|
|
}
|
|
}
|
|
}
|
|
}
|