mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-24 10:11:35 +08:00
Hide Gallery menu items on other tenants than Default. (#7511)
This commit is contained in:
committed by
Sébastien Ros
parent
9b8f84d679
commit
dfe7215a05
@@ -2,6 +2,7 @@
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Navigation;
|
||||
using Orchard.Security;
|
||||
using Orchard.Environment.Configuration;
|
||||
|
||||
namespace Orchard.Packaging {
|
||||
[OrchardFeature("Gallery")]
|
||||
@@ -11,8 +12,14 @@ namespace Orchard.Packaging {
|
||||
public string MenuName {
|
||||
get { return "admin"; }
|
||||
}
|
||||
private readonly ShellSettings _shellSettings;
|
||||
|
||||
public AdminMenu(ShellSettings shellSettings) {
|
||||
_shellSettings = shellSettings;
|
||||
}
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
if (_shellSettings.Name.ToLower() == "default") {
|
||||
builder
|
||||
.Add(T("Modules"), menu => menu
|
||||
.Add(T("Gallery"), "3", item => Describe(item, "Modules", "Gallery", true)))
|
||||
@@ -21,6 +28,7 @@ namespace Orchard.Packaging {
|
||||
.Add(T("Settings"), menu => menu
|
||||
.Add(T("Gallery"), "1", item => Describe(item, "Sources", "Gallery", false)));
|
||||
}
|
||||
}
|
||||
|
||||
static NavigationItemBuilder Describe(NavigationItemBuilder item, string actionName, string controllerName, bool localNav) {
|
||||
item = item.Action(actionName, controllerName, new { area = "Orchard.Packaging" }).Permission(StandardPermissions.SiteOwner);
|
||||
|
||||
Reference in New Issue
Block a user