Revert "Grant all users access to the content recycle bin (#14977)"

This reverts commit ed006931a4.
This commit is contained in:
Sebastiaan Janssen
2023-12-04 14:34:47 +01:00
parent c6d01178c0
commit 941705b03d

View File

@@ -384,8 +384,8 @@ public abstract class ContentTreeControllerBase : TreeController, ITreeNodeContr
/// </remarks>
protected sealed override ActionResult<TreeNodeCollection> 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<string>(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<TreeNodeCollection> 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"))
{