From ed006931a49521b1749d322483e67b3396d8a8a8 Mon Sep 17 00:00:00 2001 From: Richard Thompson Date: Sun, 22 Oct 2023 17:48:52 +0100 Subject: [PATCH] Grant all users access to the content recycle bin (#14977) * Grant all users access to the content recycle bin If users don't have access to the root node of the content section they now get access to the recycle bin. * Content editors get access to their nodes and recycle bin All users with access to the content section will get access to the recycle bin as well as the nodes they have access to, even if they don't have access to the root of the content section --- .../Trees/ContentTreeControllerBase.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs b/src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs index 930c51c713..84e7692d0c 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 && UserStartNodes.Contains(Constants.System.Root)) + // check if we're rendering the root + if (id == Constants.System.RootString) { 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,16 +402,17 @@ public abstract class ContentTreeControllerBase : TreeController, ITreeNodeContr } ActionResult nodesResult = GetTreeNodesInternal(id, queryStrings); - if (!(nodesResult.Result is null)) + + if (nodesResult.Result is not 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")) {