U4-10023 - multiple start nodes
This commit is contained in:
@@ -105,7 +105,7 @@ namespace Umbraco.Web.Trees
|
||||
// Therefore, in the latter case, we want to change the id to -1 since we want to render the current user's root node
|
||||
// and the GetChildEntities method will take care of rendering the correct root node.
|
||||
// If it is in dialog mode, then we don't need to change anything and the children will just render as per normal.
|
||||
if (IsDialog(queryStrings) == false && UserStartNodes.Length > 0 && UserStartNodes.Contains(Constants.System.Root) == false)
|
||||
if (IsDialog(queryStrings) == false && UserStartNodes.Contains(Constants.System.Root) == false)
|
||||
{
|
||||
id = Constants.System.Root.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
@@ -128,7 +128,6 @@ namespace Umbraco.Web.Trees
|
||||
// look up from GUID if it's not an integer
|
||||
if (int.TryParse(id, out iid) == false)
|
||||
{
|
||||
|
||||
var idEntity = GetEntityFromId(id);
|
||||
if (idEntity == null)
|
||||
{
|
||||
@@ -137,13 +136,13 @@ namespace Umbraco.Web.Trees
|
||||
iid = idEntity.Id;
|
||||
}
|
||||
|
||||
|
||||
//if a request is made for the root node data but the user's start node is not the default, then
|
||||
// we need to return their start nodes
|
||||
if (iid == Constants.System.Root && UserStartNodes.Length > 0 && UserStartNodes.Contains(Constants.System.Root) == false)
|
||||
// if a request is made for the root node but user has no access to
|
||||
// root node, return start nodes instead
|
||||
if (iid == Constants.System.Root && UserStartNodes.Contains(Constants.System.Root) == false)
|
||||
{
|
||||
var nodes = Services.EntityService.GetAll(UmbracoObjectType, UserStartNodes);
|
||||
return nodes;
|
||||
return UserStartNodes.Length > 0
|
||||
? Services.EntityService.GetAll(UmbracoObjectType, UserStartNodes)
|
||||
: Enumerable.Empty<IUmbracoEntity>();
|
||||
}
|
||||
|
||||
return Services.EntityService.GetChildren(iid, UmbracoObjectType).ToArray();
|
||||
@@ -169,7 +168,7 @@ namespace Umbraco.Web.Trees
|
||||
protected sealed override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
|
||||
{
|
||||
//check if we're rendering the root
|
||||
if (id == Constants.System.Root.ToInvariantString() && (UserStartNodes.Length == 0 || UserStartNodes.Contains(Constants.System.Root)))
|
||||
if (id == Constants.System.Root.ToInvariantString() && UserStartNodes.Contains(Constants.System.Root))
|
||||
{
|
||||
var altStartId = string.Empty;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user