Updating a bunch of start node checking logic to ensure that it takes the user and user group start nodes into account
This commit is contained in:
@@ -35,7 +35,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
var node = base.CreateRootNode(queryStrings);
|
||||
//if the user's start node is not default, then ensure the root doesn't have a menu
|
||||
if (Security.CurrentUser.StartMediaIds.Length > 0 && Security.CurrentUser.StartMediaIds.Contains(Constants.System.Root) == false)
|
||||
if (UserStartNodes.Length > 0 && UserStartNodes.Contains(Constants.System.Root) == false)
|
||||
{
|
||||
node.MenuUrl = "";
|
||||
}
|
||||
@@ -53,9 +53,10 @@ namespace Umbraco.Web.Trees
|
||||
get { return Services.MediaService.RecycleBinSmells(); }
|
||||
}
|
||||
|
||||
private int[] _userStartNodes;
|
||||
protected override int[] UserStartNodes
|
||||
{
|
||||
get { return Security.CurrentUser.StartMediaIds; }
|
||||
get { return _userStartNodes ?? (_userStartNodes = Security.CurrentUser.GetCombinedStartMediaIds().ToArray()); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -100,7 +101,7 @@ namespace Umbraco.Web.Trees
|
||||
if (id == Constants.System.Root.ToInvariantString())
|
||||
{
|
||||
//if the user's start node is not the root then ensure the root menu is empty/doesn't exist
|
||||
if (Security.CurrentUser.StartMediaIds.Length > 0 && Security.CurrentUser.StartMediaIds.Contains(Constants.System.Root) == false)
|
||||
if (UserStartNodes.Length > 0 && UserStartNodes.Contains(Constants.System.Root) == false)
|
||||
{
|
||||
return menu;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user