private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.GetLocalizer <WeChatPayResource>(); //Add main menu items. var weChatPayManagementMenuItem = new ApplicationMenuItem(WeChatPayMenus.Prefix, l["Menu:WeChatPayManagement"]); if (await context.IsGrantedAsync(WeChatPayPermissions.PaymentRecords.Default)) { weChatPayManagementMenuItem.AddItem( new ApplicationMenuItem(WeChatPayMenus.PaymentRecord, l["Menu:PaymentRecord"], "/PaymentService/WeChatPay/PaymentRecords/PaymentRecord") ); } if (await context.IsGrantedAsync(WeChatPayPermissions.RefundRecords.Default)) { weChatPayManagementMenuItem.AddItem( new ApplicationMenuItem(WeChatPayMenus.RefundRecord, l["Menu:RefundRecord"], "/PaymentService/WeChatPay/RefundRecords/RefundRecord") ); } if (!weChatPayManagementMenuItem.Items.IsNullOrEmpty()) { var paymentServiceMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == WeChatPayMenus.ModuleGroupPrefix, () => new ApplicationMenuItem(WeChatPayMenus.ModuleGroupPrefix, l["Menu:EasyAbpPaymentService"])); paymentServiceMenuItem.Items.Add(weChatPayManagementMenuItem); } }
private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.GetLocalizer <DynamicEntityResource>(); //Add main menu items. if (await context.IsGrantedAsync(DynamicEntityPermissions.FieldDefinition.Default) || await context.IsGrantedAsync(DynamicEntityPermissions.ModelDefinition.Default) ) { var menu = new ApplicationMenuItem(DynamicEntityMenus.DynamicEntityManagement, l["Menu:DynamicEntityManagement"]); if (await context.IsGrantedAsync(DynamicEntityPermissions.FieldDefinition.Default)) { menu.AddItem( new ApplicationMenuItem(DynamicEntityMenus.FieldDefinition, l["Menu:FieldDefinition"], "/DynamicEntity/FieldDefinition") ); } if (await context.IsGrantedAsync(DynamicEntityPermissions.ModelDefinition.Default)) { menu.AddItem( new ApplicationMenuItem(DynamicEntityMenus.ModelDefinition, l["Menu:ModelDefinition"], "/DynamicEntity/ModelDefinition") ); } context.Menu.AddItem(menu); } }
public virtual Task ConfigureMenuAsync(MenuConfigurationContext context) { if (context.Menu.Name != StandardMenus.Main) { return(Task.CompletedTask); } var administrationMenu = context.Menu.GetAdministration(); var l = context.GetLocalizer <IdentityResource>(); var identityMenuItem = new ApplicationMenuItem(IdentityMenuNames.GroupName, l["Menu:IdentityManagement"], icon: "far fa-id-card"); administrationMenu.AddItem(identityMenuItem); identityMenuItem.AddItem(new ApplicationMenuItem( IdentityMenuNames.Roles, l["Roles"], url: "~/identity/roles").RequirePermissions(IdentityPermissions.Roles.Default)); identityMenuItem.AddItem(new ApplicationMenuItem( IdentityMenuNames.Users, l["Users"], url: "~/identity/users").RequirePermissions(IdentityPermissions.Users.Default)); return(Task.CompletedTask); }
private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.GetLocalizer <PrepaymentResource>(); //Add main menu items. var prepaymentManagementMenuItem = new ApplicationMenuItem(PrepaymentMenus.Prefix, l["Menu:PrepaymentManagement"]); if (await context.IsGrantedAsync(PrepaymentPermissions.Account.Manage)) { prepaymentManagementMenuItem.AddItem( new ApplicationMenuItem(PrepaymentMenus.Account, l["Menu:Account"], "/PaymentService/Prepayment/Accounts/Account") ); } if (await context.IsGrantedAsync(PrepaymentPermissions.WithdrawalRequest.Manage)) { prepaymentManagementMenuItem.AddItem( new ApplicationMenuItem(PrepaymentMenus.WithdrawalRequest, l["Menu:WithdrawalRequest"], "/PaymentService/Prepayment/WithdrawalRequests/WithdrawalRequest") ); } if (!prepaymentManagementMenuItem.Items.IsNullOrEmpty()) { var paymentServiceMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == PrepaymentMenus.ModuleGroupPrefix, () => new ApplicationMenuItem(PrepaymentMenus.ModuleGroupPrefix, l["Menu:EasyAbpPaymentService"])); paymentServiceMenuItem.Items.Add(prepaymentManagementMenuItem); } }
private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.GetLocalizer <PaymentServiceResource>(); //Add main menu items. var paymentManagementMenuItem = new ApplicationMenuItem(PaymentServiceMenus.Prefix, l["Menu:PaymentService"]); if (await context.IsGrantedAsync(PaymentServicePermissions.Payments.Manage)) { paymentManagementMenuItem.AddItem( new ApplicationMenuItem(PaymentServiceMenus.Payment, l["Menu:Payment"], "/PaymentService/Payments/Payment") ); } if (await context.IsGrantedAsync(PaymentServicePermissions.Refunds.Manage)) { paymentManagementMenuItem.AddItem( new ApplicationMenuItem(PaymentServiceMenus.Refund, l["Menu:Refund"], "/PaymentService/Refunds/Refund") ); } if (!paymentManagementMenuItem.Items.IsNullOrEmpty()) { context.Menu.Items.GetOrAdd(i => i.Name == PaymentServiceMenus.Prefix, () => paymentManagementMenuItem); } }
private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.GetLocalizer <MiniProgramsResource>(); //Add main menu items. var miniProgramManagementMenuItem = new ApplicationMenuItem(MiniProgramsMenus.Prefix, l["Menu:MiniProgramManagement"]); if (await context.IsGrantedAsync(MiniProgramsPermissions.MiniProgram.Default)) { miniProgramManagementMenuItem.AddItem( new ApplicationMenuItem(MiniProgramsMenus.MiniProgram, l["Menu:MiniProgram"], "/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram") ); } if (await context.IsGrantedAsync(MiniProgramsPermissions.MiniProgramUser.Default)) { miniProgramManagementMenuItem.AddItem( new ApplicationMenuItem(MiniProgramsMenus.MiniProgramUser, l["Menu:MiniProgramUser"], "/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser") ); } if (await context.IsGrantedAsync(MiniProgramsPermissions.UserInfo.Default)) { miniProgramManagementMenuItem.AddItem( new ApplicationMenuItem(MiniProgramsMenus.UserInfo, l["Menu:UserInfo"], "/WeChatManagement/MiniPrograms/UserInfos/UserInfo") ); } if (!miniProgramManagementMenuItem.Items.IsNullOrEmpty()) { var weChatManagementMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == MiniProgramsMenus.ModuleGroupPrefix, () => new ApplicationMenuItem("EasyAbpWeChatManagement", l["Menu:EasyAbpWeChatManagement"])); weChatManagementMenuItem.Items.Add(miniProgramManagementMenuItem); } }
public async Task ConfigureMenuAsync(MenuConfigurationContext context) { if (context.Menu.Name != StandardMenus.Main) { return; } var administrationMenu = context.Menu.GetAdministration(); var authorizationService = context.ServiceProvider.GetRequiredService <IAuthorizationService>(); 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); if (await authorizationService.IsGrantedAsync(IdentityPermissions.Roles.Default)) { identityMenuItem.AddItem(new ApplicationMenuItem(IdentityMenuNames.Roles, l["Roles"], url: "/Identity/Roles")); } if (await authorizationService.IsGrantedAsync(IdentityPermissions.Users.Default)) { identityMenuItem.AddItem(new ApplicationMenuItem(IdentityMenuNames.Users, l["Users"], url: "/Identity/Users")); } }
private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.ServiceProvider.GetRequiredService <IStringLocalizer <CmsResource> >(); //Add main menu items. var authorizationService = context.ServiceProvider.GetRequiredService <IAuthorizationService>(); var cmsMenuItem = new ApplicationMenuItem("Cms", l["Menu:Cms"]); if (await authorizationService.IsGrantedAsync(CmsPermissions.Categories.Default)) { cmsMenuItem.AddItem( new ApplicationMenuItem("Category", l["Menu:Category"], "/Cms/Categories/Category") ); } if (await authorizationService.IsGrantedAsync(CmsPermissions.Articles.Default)) { cmsMenuItem.AddItem( new ApplicationMenuItem("Article", l["Menu:Article"], "/Cms/Articles/Article") ); } if (!cmsMenuItem.Items.IsNullOrEmpty()) { context.Menu.Items.Add(cmsMenuItem); } }
private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.GetLocalizer <ProductsResource>(); //Add main menu items. var productManagementMenuItem = new ApplicationMenuItem(ProductsMenus.Prefix, l["Menu:ProductManagement"]); if (await context.IsGrantedAsync(ProductsPermissions.Categories.Manage)) { productManagementMenuItem.AddItem( new ApplicationMenuItem(ProductsMenus.Category, l["Menu:Category"], "/EShop/Products/Categories/Category") ); } if (await context.IsGrantedAsync(ProductsPermissions.Products.Manage)) { productManagementMenuItem.AddItem( new ApplicationMenuItem(ProductsMenus.Product, l["Menu:Product"], "/EShop/Products/Products/Product") ); } if (!productManagementMenuItem.Items.IsNullOrEmpty()) { var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == ProductsMenus.ModuleGroupPrefix, () => new ApplicationMenuItem(ProductsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"], icon: "fa fa-shopping-bag")); eShopMenuItem.Items.Add(productManagementMenuItem); } }
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) { var l = context.GetLocalizer <BookManagementResource>(); context.Menu.Items.Insert(0, new ApplicationMenuItem("BookStore.Home", l["Menu:Home"], "~/")); var bookStoreMenu = new ApplicationMenuItem( "BooksStore", l["Menu:BookManagement"], icon: "fa fa-book" ); context.Menu.AddItem(bookStoreMenu); //CHECK the PERMISSION if (await context.AuthorizationService.IsGrantedAsync(BookManagementPermissions.Books.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Books", l["Menu:Books"], url: "/Books" )); } //CHECK the PERMISSION if (await context.AuthorizationService.IsGrantedAsync(BookManagementPermissions.Authors.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Authors", l["Menu:Authors"], url: "/Authors" )); } }
private async Task AddGigMenu(MenuConfigurationContext context, IStringLocalizer l) { var gigsMenu = new ApplicationMenuItem( Zero1FiveMenus.Gig.Name, l["Menu:Gigs"], "", icon: "" ); gigsMenu.AddItem( new ApplicationMenuItem( Zero1FiveMenus.Gig.List, l["Menu:Gigs"], Zero1FiveMenus.Gig.ListUrl, icon: "fas fa-list" )); if (await context.IsGrantedAsync(Zero1FivePermissions.Gigs.Default)) { gigsMenu.AddItem( new ApplicationMenuItem( Zero1FiveMenus.Gig.Manage, l["Menu:ManageGigs"], Zero1FiveMenus.Gig.ManageUrl, icon: "fas fa-list", requiredPermissionName: Zero1FivePermissions.Gigs.Default )); } context.Menu.Items.Insert(1, gigsMenu); }
private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.GetLocalizer <GiftCardManagementResource>(); //Add main menu items. var menuItem = new ApplicationMenuItem(GiftCardManagementMenus.Prefix, l["Menu:GiftCardManagement"]); if (await context.IsGrantedAsync(GiftCardManagementPermissions.GiftCardTemplates.Default)) { menuItem.AddItem( new ApplicationMenuItem(GiftCardManagementMenus.GiftCardTemplate, l["Menu:GiftCardTemplate"], "/GiftCardManagement/GiftCardTemplates/GiftCardTemplate") ); } if (await context.IsGrantedAsync(GiftCardManagementPermissions.GiftCards.Consume)) { menuItem.AddItem( new ApplicationMenuItem(GiftCardManagementMenus.GiftCardConsumption, l["Menu:GiftCardConsumption"], "/GiftCardManagement/GiftCards/GiftCard/Consume") ); } if (!menuItem.Items.IsNullOrEmpty()) { context.Menu.AddItem(menuItem); } }
private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.GetLocalizer <CouponsResource>(); //Add main menu items. var couponManagementMenuItem = new ApplicationMenuItem(CouponsMenus.Prefix, l["Menu:CouponManagement"]); if (await context.IsGrantedAsync(CouponsPermissions.CouponTemplate.Default)) { couponManagementMenuItem.AddItem( new ApplicationMenuItem(CouponsMenus.CouponTemplate, l["Menu:CouponTemplate"], "/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate") ); } if (await context.IsGrantedAsync(CouponsPermissions.Coupon.Default)) { couponManagementMenuItem.AddItem( new ApplicationMenuItem(CouponsMenus.Coupon, l["Menu:Coupon"], "/EShop/Plugins/Coupons/Coupons/Coupon") ); } if (!couponManagementMenuItem.Items.IsNullOrEmpty()) { var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == CouponsMenus.ModuleGroupPrefix, () => new ApplicationMenuItem(CouponsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"], icon: "fa fa-shopping-bag")); eShopMenuItem.Items.Add(couponManagementMenuItem); } }
public virtual async Task ConfigureMenuAsync(MenuConfigurationContext context) { if (context.Menu.Name != StandardMenus.Main) { return; } var hasRolePermission = await context.IsGrantedAsync(IdentityPermissions.Roles.Default); var hasUserPermission = await context.IsGrantedAsync(IdentityPermissions.Users.Default); if (hasRolePermission || hasUserPermission) { var administrationMenu = context.Menu.GetAdministration(); var l = context.GetLocalizer <IdentityResource>(); var identityMenuItem = new ApplicationMenuItem(IdentityMenuNames.GroupName, l["Menu:IdentityManagement"], icon: "fa fa-id-card-o"); administrationMenu.AddItem(identityMenuItem); if (hasRolePermission) { identityMenuItem.AddItem(new ApplicationMenuItem(IdentityMenuNames.Roles, l["Roles"], url: "~/Identity/Roles")); } if (hasUserPermission) { identityMenuItem.AddItem(new ApplicationMenuItem(IdentityMenuNames.Users, l["Users"], url: "~/Identity/Users")); } } }
private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<GiftCardManagementResource>>(); //Add main menu items. var menuItem = new ApplicationMenuItem("GiftCardManagement", l["Menu:GiftCardManagement"]); var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>(); if (await authorizationService.IsGrantedAsync(GiftCardManagementPermissions.GiftCardTemplates.Default)) { menuItem.AddItem( new ApplicationMenuItem("GiftCardTemplate", l["Menu:GiftCardTemplate"], "/GiftCardManagement/GiftCardTemplates/GiftCardTemplate") ); } if (await authorizationService.IsGrantedAsync(GiftCardManagementPermissions.GiftCards.Consume)) { menuItem.AddItem( new ApplicationMenuItem("GiftCardConsumption", l["Menu:GiftCardConsumption"], "/GiftCardManagement/GiftCards/GiftCard/Consume") ); } if (!menuItem.Items.IsNullOrEmpty()) { context.Menu.AddItem(menuItem); } }
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) { if (!MultiTenancyConsts.IsEnabled) { var administration = context.Menu.GetAdministration(); administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName); } var l = context.GetLocalizer <MyBookStoreResource>(); context.Menu.Items.Insert(0, new ApplicationMenuItem(MyBookStoreMenus.Home, l["Menu:Home"], "~/")); var bookStoreMenu = new ApplicationMenuItem( "BooksStore", l["Menu:BookStore"], icon: "fa fa-book"); context.Menu.AddItem(bookStoreMenu); //CHECK the PERMISSION if (await context.IsGrantedAsync(MyBookStorePermissions.Books.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Books", l["Menu:Books"], url: "/Books" )); } if (await context.IsGrantedAsync(MyBookStorePermissions.Authors.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Authors", l["Menu:Authors"], url: "/Authors" )); } }
private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.GetLocalizer <PaymentsResource>(); //Add main menu items. var paymentManagementMenuItem = new ApplicationMenuItem("PaymentManagement", l["Menu:PaymentManagement"]); var storeAppService = context.ServiceProvider.GetRequiredService <IStoreAppService>(); var defaultStore = (await storeAppService.GetDefaultAsync())?.Id; if (await context.IsGrantedAsync(PaymentsPermissions.Payments.Manage)) { paymentManagementMenuItem.AddItem( new ApplicationMenuItem("Payments", l["Menu:Payments"], "/EShop/Payments/Payments/Payment?storeId=" + defaultStore) ); } if (await context.IsGrantedAsync(PaymentsPermissions.Refunds.Manage)) { paymentManagementMenuItem.AddItem( new ApplicationMenuItem("Refunds", l["Menu:Refunds"], "/EShop/Payments/Refunds/Refund?storeId=" + defaultStore) ); } if (!paymentManagementMenuItem.Items.IsNullOrEmpty()) { var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == "EasyAbpEShop", () => new ApplicationMenuItem("EasyAbpEShop", l["Menu:EasyAbpEShop"])); eShopMenuItem.Items.Add(paymentManagementMenuItem); } }
public async Task ConfigureMenuAsync(MenuConfigurationContext context) { if (context.Menu.Name != StandardMenus.Main) { return; } var appLocalizer = context.GetLocalizer <MyAbpResource>(); context.Menu.Items.Insert( 0, new ApplicationMenuItem( "MyAbp.Home", appLocalizer["Menu:Home"], "/", icon: "home" ) ); var administrationMenu = context.Menu.GetAdministration(); administrationMenu.Items.RemoveAll(m => true); administrationMenu.Icon = "global"; administrationMenu.Url = "/admin"; var hasTenantPermission = await context.IsGrantedAsync(TenantManagementPermissions.Tenants.Default); if (hasTenantPermission) { var tenantLocalizer = context.GetLocalizer <AbpTenantManagementResource>(); var tenantManagementMenuItem = new ApplicationMenuItem(TenantManagementMenuNames.GroupName, tenantLocalizer["Menu:TenantManagement"], url: "/tenant", icon: "solution"); administrationMenu.AddItem(tenantManagementMenuItem); tenantManagementMenuItem.AddItem(new ApplicationMenuItem(TenantManagementMenuNames.Tenants, tenantLocalizer["Tenants"], url: "/tenant/tenants")); } var hasRolePermission = await context.IsGrantedAsync(IdentityPermissions.Roles.Default); var hasUserPermission = await context.IsGrantedAsync(IdentityPermissions.Users.Default); if (hasRolePermission || hasUserPermission) { var identityLocalizer = context.GetLocalizer <IdentityResource>(); var identityMenuItem = new ApplicationMenuItem(IdentityMenuNames.GroupName, identityLocalizer["Menu:IdentityManagement"], url: "/identitys", icon: "team"); administrationMenu.AddItem(identityMenuItem); if (hasRolePermission) { identityMenuItem.AddItem(new ApplicationMenuItem(IdentityMenuNames.Roles, identityLocalizer["Roles"], url: "/identitys/roles")); } if (hasUserPermission) { identityMenuItem.AddItem(new ApplicationMenuItem(IdentityMenuNames.Users, identityLocalizer["Users"], url: "/identitys/users")); } } }
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) { var l = context.GetLocalizer <BookStoreResource>(); context.Menu.Items.Insert( 0, new ApplicationMenuItem( "BookStore.Home", l["Menu:Home"], "/", icon: "fas fa-home" ) ); //context.Menu.AddItem( // new ApplicationMenuItem( // "BooksStore", // l["Menu:BookStore"], // icon: "fa fa-book" // ).AddItem( // new ApplicationMenuItem( // "BooksStore.Books", // l["Menu:Books"], // url: "/books" // ) // ) //); var bookStoreMenu = new ApplicationMenuItem( "BooksStore", l["Menu:BookStore"], icon: "fa fa-book" ); context.Menu.AddItem(bookStoreMenu); //CHECK the PERMISSION if (await context.IsGrantedAsync(BookStorePermissions.Books.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Books", l["Menu:Books"], url: "/books" )); } if (await context.IsGrantedAsync(BookStorePermissions.Authors.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Authors", l["Menu:Authors"], url: "/authors" )); } }
public virtual async Task ConfigureMenuAsync(MenuConfigurationContext context) { if (context.Menu.Name != StandardMenus.Main) { return; } var l = context.GetLocalizer <DocumentManagementResource>(); var documentManagementMenuItem = new ApplicationMenuItem(DocumentManagementMenuNames.GroupName, l["Menu:DocumentManagement"], icon: "fa fa-book"); context.Menu.AddItem(documentManagementMenuItem); documentManagementMenuItem.AddItem(new ApplicationMenuItem(DocumentManagementMenuNames.Documents, l["Documents"], url: "~/DocumentManagement/Documents")); //, requiredPermissionName: DocumentManagementPermissions.Documents.Default)); var operationMenuItem = new ApplicationMenuItem(DocumentManagementMenuNames.OperationData, l["MenuOperationData"], url: "#"); documentManagementMenuItem.AddItem(operationMenuItem); var documentTypes = await _documentTypeAppService.GetListAsync(new GetDocumentTypesInput { MaxResultCount = 1000, SkipCount = 0 }); if (documentTypes != null && documentTypes.Items.Any()) { foreach (var documentType in documentTypes.Items) { operationMenuItem.Items.Add(new ApplicationMenuItem(documentType.Code, documentType.Name, url: $"~/DocumentManagement/Documents/OperationData?Code={documentType.Code}")); } } var departmentMenuItem = new ApplicationMenuItem(DocumentManagementMenuNames.DepartmentData, l["MenuDepartmentData"], url: $"#"); documentManagementMenuItem.AddItem(departmentMenuItem); var departments = await _departmentAppService.GetListAsync(new GetDepartmentsInput { MaxResultCount = 1000, SkipCount = 0 }); if (departments != null && departments.Items.Any()) { foreach (var department in departments.Items) { departmentMenuItem.Items.Add(new ApplicationMenuItem(department.Code, department.Name, url: $"~/DocumentManagement/Documents/DepartmentData?Code={department.Code}")); } } return; }
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) { if (!MultiTenancyConsts.IsEnabled) { var administration = context.Menu.GetAdministration(); administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName); } var l = context.GetLocalizer <BookStoreResource>(); context.Menu.Items.Insert(0, new ApplicationMenuItem("BookStore.Home", l["Menu:Home"], "~/")); var bookStoreMenu = new ApplicationMenuItem( "BooksStore", l["Menu:BookStore"], icon: "fas fa-chevron-circle-down" ); //CHECK the PERMISSION OF AUTHORS IN BOOKSTOREMENU CONTRIBUTOR if (await context.IsGrantedAsync(BookStorePermissions.Authors.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Authors", l["Menu:Authors"], url: "/Authors", icon: "fas fa-chevron-right" )); } //CHECK the PERMISSION if (await context.IsGrantedAsync(BookStorePermissions.Books.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Books", l["Menu:Books"], url: "/Books", icon: "fas fa-chevron-right" )); } //CHECK the PERMISSION OF SLIDE if (await context.IsGrantedAsync(BookStorePermissions.Slides.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Slides", l["Menu:Slides"], url: "/Slides", icon: "fas fa-chevron-right" )); } context.Menu.AddItem(bookStoreMenu); }
private async Task ConfigureSideMenuAsync(MenuConfigurationContext context) { var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<ApiGatewayResource>>(); var oceloteMenu = new ApplicationMenuItem("WebService.Menu.Ocelot", l["Side:Ocelot"], "#"); oceloteMenu.AddItem(new ApplicationMenuItem("WebService.Menu.Ocelot.Global", l["Side:Ocelot:Global"], "/OcelotConfiguration/Global")); oceloteMenu.AddItem(new ApplicationMenuItem("WebService.Menu.Ocelot.ReRoutes", l["Side:Ocelot:ReRoutes"], "/OcelotConfiguration/ReRoutes")); oceloteMenu.AddItem(new ApplicationMenuItem("WebService.Menu.Ocelot.Source", l["Side:Ocelot:Source"], "/OcelotConfiguration/Source")); var clusterOcelotMenu = new ApplicationMenuItem("WebService.Menu.ClusterOcelot", l["Side:ClusterOcelot"], "#"); clusterOcelotMenu.AddItem(new ApplicationMenuItem("WebService.Menu.ClusterOcelot.ServerList", l["Side:ClusterOcelot:ServerList"], "/ClusterOcelot/ServerList")); context.Menu.Items.AddRange(new List<ApplicationMenuItem> { clusterOcelotMenu, oceloteMenu }); await Task.CompletedTask; }
private Task ConfigureMainMenuAsync(MenuConfigurationContext context) { var administrationMenu = context.Menu.GetAdministration(); var l = context.GetLocalizer <DocsResource>(); var rootMenuItem = new ApplicationMenuItem(DocsMenuNames.GroupName, l["Menu:Documents"], icon: "fa fa-book"); administrationMenu.AddItem(rootMenuItem); rootMenuItem.AddItem(new ApplicationMenuItem(DocsMenuNames.Projects, l["Menu:ProjectManagement"], "~/Docs/Admin/Projects", requiredPermissionName: DocsAdminPermissions.Projects.Default)); rootMenuItem.AddItem(new ApplicationMenuItem(DocsMenuNames.Documents, l["Menu:DocumentManagement"], "~/Docs/Admin/Documents", requiredPermissionName: DocsAdminPermissions.Documents.Default)); return(Task.CompletedTask); }
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) { var l = context.GetLocalizer <ContabilidadResource>(); var currentUser = context.ServiceProvider.GetRequiredService <ICurrentUser>(); var AuthorizationService = context.ServiceProvider.GetRequiredService <IAuthorizationService>(); context.Menu.Items.Insert( 0, new ApplicationMenuItem( "Contabilidad.Home", l["Menu:Home"], "/", icon: "fas fa-home" ) ); if (currentUser.IsAuthenticated) { var configMenu = new ApplicationMenuItem( "Config", l["Menu:Config"], "/", icon: "fas fa-cog" ).AddItem(new ApplicationMenuItem("Config.Monedas", l["Menu:Config.Monedas"], url: "/configuracion/monedas")); if (await AuthorizationService.IsGrantedAsync(ContaPermissions.Cotizacion.Default)) { configMenu.AddItem(new ApplicationMenuItem("Config.Cotizacion", l["Menu:Config.Cotizacion"], "/configuracion/cotizacion")); } if (await AuthorizationService.IsGrantedAsync(ContaPermissions.Account.Plan)) { configMenu.AddItem(new ApplicationMenuItem("Cuentas", l["Menu:Account"], url: "/cuentas")); } if (await AuthorizationService.IsGrantedAsync(ContaPermissions.CentroDeCostos.Default)) { configMenu.AddItem(new ApplicationMenuItem("CentroCosto", l["Menu:CentroCosto"], url: "/configuracion/Centrodecostos")); } if (await AuthorizationService.IsGrantedAsync(ContaPermissions.PeriodoContable.Default)) { configMenu.AddItem(new ApplicationMenuItem("PeriodosContables", l["Menu:PeriodosContables"], url: "/configuracion/periodos")); } context.Menu.Items.Insert(1, configMenu); } }
private Task ConfigureMainMenuAsync(MenuConfigurationContext context) { //Add main menu items. var l = context.GetLocalizer <MasterDataResource>(); var masterDataMenuItem = new ApplicationMenuItem(MasterDataMenus.Prefix, displayName: l["Menu:MasterData"], "~/MasterData", icon: "fa fa-database"); context.Menu.AddItem(masterDataMenuItem); masterDataMenuItem.AddItem(new ApplicationMenuItem(MasterDataMenus.Company, l["Companies"], url: "~/MasterData/Companies")); masterDataMenuItem.AddItem(new ApplicationMenuItem(MasterDataMenus.Department, l["Departments"], url: "~/MasterData/Departments")); masterDataMenuItem.AddItem(new ApplicationMenuItem(MasterDataMenus.DocumentType, l["DocumentTypes"], url: "~/MasterData/DocumentTypes")); masterDataMenuItem.AddItem(new ApplicationMenuItem(MasterDataMenus.Module, l["Modules"], url: "~/MasterData/Modules")); return(Task.CompletedTask); }
public virtual Task ConfigureMenuAsync(MenuConfigurationContext context) { if (context.Menu.Name != StandardMenus.Main) { return(Task.CompletedTask); } var administrationMenu = context.Menu.GetAdministration(); var l = context.GetLocalizer <AbpTenantManagementResource>(); var tenantManagementMenuItem = new ApplicationMenuItem( TenantManagementMenuNames.GroupName, l["Menu:TenantManagement"], icon: "fa fa-users" ); administrationMenu.AddItem(tenantManagementMenuItem); tenantManagementMenuItem.AddItem(new ApplicationMenuItem( TenantManagementMenuNames.Tenants, l["Tenants"], url: "~/tenant-management/tenants", requiredPermissionName: TenantManagementPermissions.Tenants.Default )); return(Task.CompletedTask); }
private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.GetLocalizer <OrdersResource>(); //Add main menu items. var orderManagementMenuItem = new ApplicationMenuItem(OrdersMenus.Prefix, l["Menu:OrderManagement"]); if (await context.IsGrantedAsync(OrdersPermissions.Orders.Manage)) { var storeAppService = context.ServiceProvider.GetRequiredService <IStoreAppService>(); var defaultStore = (await storeAppService.GetDefaultAsync())?.Id; orderManagementMenuItem.AddItem( new ApplicationMenuItem(OrdersMenus.Order, l["Menu:Order"], "/EShop/Orders/Orders/Order?storeId=" + defaultStore) ); } if (!orderManagementMenuItem.Items.IsNullOrEmpty()) { var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == OrdersMenus.ModuleGroupPrefix, () => new ApplicationMenuItem(OrdersMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"])); eShopMenuItem.Items.Add(orderManagementMenuItem); } }
public Task ConfigureMenuAsync(MenuConfigurationContext context) { if (context.Menu.Name != MenuName) { return(Task.CompletedTask); } var products = new ApplicationMenuItem("Products", "Products", "/products"); context.Menu.Items.Add(products); products.AddItem(new ApplicationMenuItem("AspNetZero", "AspNetZero", url: "/products/aspnetzero")); products.AddItem(new ApplicationMenuItem("ABP", "ABP", url: "/products/abp")); return(Task.CompletedTask); }
public async Task ConfigureMenuAsync(MenuConfigurationContext context) { if (context.Menu.DisplayName != StandardMenus.Main) { return; } var l = context.GetLocalizer <BookStoreResource>(); context.Menu.Items.Insert( 0, new ApplicationMenuItem( "BookStore.Home", l["Menu:Home"], "/", icon: "fas fa-home" ) ); var bookStoreMenu = new ApplicationMenuItem( "BooksStore", l["Menu:BookStore"], icon: "fa fa-book" ); context.Menu.AddItem(bookStoreMenu); //CHECK the PERMISSION if (await context.IsGrantedAsync(BookStorePermissions.Books.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Books", l["Menu:Books"], url: "/books" )); } if (await context.IsGrantedAsync(BookStorePermissions.Authors.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Authors", l["Menu:Authors"], url: "/authors" )); } }
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) { var administration = context.Menu.GetAdministration(); var l = context.GetLocalizer <BookStoreResource>(); var bookStoreMenu = new ApplicationMenuItem( "BooksStore", l["Menu:BookStore"], icon: "fa fa-book" ); context.Menu.AddItem(bookStoreMenu); //CHECK the PERMISSION if (await context.IsGrantedAsync(BookStorePermissions.Books.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Books", l["Menu:Books"], url: "/Books" )); } if (await context.IsGrantedAsync(BookStorePermissions.Authors.Default)) { bookStoreMenu.AddItem(new ApplicationMenuItem( "BooksStore.Authors", l["Menu:Authors"], url: "/Authors" )); } if (MultiTenancyConsts.IsEnabled) { administration.SetSubItemOrder(TenantManagementMenuNames.GroupName, 1); } else { administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName); } administration.SetSubItemOrder(IdentityMenuNames.GroupName, 2); administration.SetSubItemOrder(SettingManagementMenuNames.GroupName, 3); }