mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Limit Admin Menu for Content
Limit the Content Menu item by whether you have the base Permission EditOwnContent. EditContent implies EditOwnContent so either permission (which you need at least one of to do any management of content be it create or edit) will allow this menu item to display.
This commit is contained in:
@@ -22,6 +22,7 @@ namespace Orchard.Core.Contents {
|
||||
var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name);
|
||||
builder.AddImageSet("content")
|
||||
.Add(T("Content"), "1.4", menu => menu
|
||||
.Permission(Permissions.EditOwnContent)
|
||||
.Add(T("Content Items"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" }).LocalNav()));
|
||||
var contentTypes = contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Creatable).OrderBy(ctd => ctd.DisplayName);
|
||||
if (contentTypes.Any()) {
|
||||
|
||||
Reference in New Issue
Block a user