From 941705b03de1d00676c2889c4438465e2709d55a Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 4 Dec 2023 14:34:47 +0100 Subject: [PATCH] Revert "Grant all users access to the content recycle bin (#14977)" This reverts commit ed006931a49521b1749d322483e67b3396d8a8a8. --- .../Trees/ContentTreeControllerBase.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs b/src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs index 84e7692d0c..930c51c713 100644 --- a/src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs +++ b/src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs @@ -384,8 +384,8 @@ public abstract class ContentTreeControllerBase : TreeController, ITreeNodeContr /// protected sealed override ActionResult GetTreeNodes(string id, FormCollection queryStrings) { - // check if we're rendering the root - if (id == Constants.System.RootString) + //check if we're rendering the root + if (id == Constants.System.RootString && UserStartNodes.Contains(Constants.System.Root)) { var altStartId = string.Empty; @@ -394,7 +394,7 @@ public abstract class ContentTreeControllerBase : TreeController, ITreeNodeContr altStartId = queryStrings.GetValue(TreeQueryStringParameters.StartNodeId); } - // check if a request has been made to render from a specific start node + //check if a request has been made to render from a specific start node if (string.IsNullOrEmpty(altStartId) == false && altStartId != "undefined" && altStartId != Constants.System.RootString) { @@ -402,17 +402,16 @@ public abstract class ContentTreeControllerBase : TreeController, ITreeNodeContr } ActionResult nodesResult = GetTreeNodesInternal(id, queryStrings); - - if (nodesResult.Result is not null) + if (!(nodesResult.Result is null)) { return nodesResult.Result; } TreeNodeCollection? nodes = nodesResult.Value; - // only render the recycle bin if we are not in dialog and the start id is still the root - // we need to check for the "application" key in the queryString because its value is required here, - // and for some reason when there are no dashboards, this parameter is missing + //only render the recycle bin if we are not in dialog and the start id is still the root + //we need to check for the "application" key in the queryString because its value is required here, + //and for some reason when there are no dashboards, this parameter is missing if (IsDialog(queryStrings) == false && id == Constants.System.RootString && queryStrings.HasKey("application")) {