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
This commit is contained in:
Richard Thompson
2023-10-22 17:48:52 +01:00
committed by GitHub
parent 16c5c4c4e8
commit ed006931a4

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 && 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<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,16 +402,17 @@ public abstract class ContentTreeControllerBase : TreeController, ITreeNodeContr
}
ActionResult<TreeNodeCollection> 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"))
{