U4-10275 - Render 'site' nodes for the content/media trees for users with non root access

Created by Shannon Deminick 09 Aug 2017, 12:24:24 Updated by Mads Rasmussen 10 Sep 2017, 16:05:36

Relates to: U4-10156

Subtask of: UAASSCRUM-1073

Currently we just render the start nodes which can be confusing especially if both start nodes are named the same.

Instead when rendering the normal content/media trees we'll look up the 'site' nodes for each start node and deduplicate them, then render out the tree based on those start nodes.

We'll inject some metadata into each node to tell the UI how to interact wi the tree node.

4 Attachments


Andy Butland 09 Aug 2017, 15:14:57

On this one, I'd been starting to think about it having read the [discussion on the forum|https://our.umbraco.org/forum/using-umbraco-and-getting-started/87335-umbraco-77-thoughts-regarding-users-and-groups]. But is seems there are some single site scenarios where this issue would still arise (such as the "Hospital website" example in the linked discussion).

Given that, I was taken with [this suggestion|https://our.umbraco.org/forum/using-umbraco-and-getting-started/87335-umbraco-77-thoughts-regarding-users-and-groups#comment-276909] of having custom labels or suffixes for start nodes that could be set by the person managing the user accounts. So, continuing with that example, you could have the user seeing clearly labelled start nodes of "Cardiology news", "Radiology news" etc. Thoughts?

Shannon Deminick 10 Aug 2017, 04:34:17

If we show the 'site' nodes, you cannot have 2x 'site' nodes with the same name so I can't see there being any confusion.

Andy Butland 10 Aug 2017, 05:09:51

Maybe I'm misunderstanding the intention, but the "Hospital website" example (second one on the discussion linked above) is only for a single site, but with several "News" sections. So trying to create a user that can manage "News" sections would presumably still show the problem of multiple start nodes with the same name, and with no "site" to disambiguate them?

Shannon Deminick 10 Aug 2017, 05:21:10

Yes so the 'Hospitalwebsite' example if you had 2x start nodes Hospitalwebsite/Departments/Cardiology/News and Hospitalwebsite/Departments/Radiology/News , then we'd lookup the 'site' node for both of those nodes and deduplicate (as per notes above), meaning that the tree will start from the 'Hospitalwebsite' root node. We will then disable any nodes that cannot be clicked on their way down to the actual start nodes.

Andy Butland 10 Aug 2017, 08:05:09

Ah understood, that'll work, hadn't realised you were intending to have the editor click through the levels down to find the actual start node. Just to say then I had started having a look at the alternative "custom labels for each start node" idea, so if for any reason you do go back to that let me know and can look to finish off.

Asbjørn Riis-Knudsen 10 Aug 2017, 16:22:02

@Shandem Will the tree then auto-expand to the actual start node?

Shannon Deminick 31 Aug 2017, 14:49:04

@mads this is ready for review. Here's a quick video of it too: https://www.youtube.com/watch?v=TTd932ueToo

Can you please test it works as expected and also fix up the crappy styling I've done :)

Shannon Deminick 04 Sep 2017, 08:15:11

Having this in place should fix this: http://issues.umbraco.org/issue/U4-10156

Mads Rasmussen 05 Sep 2017, 07:32:33

@Shandem I have some troubles getting this work.

My test cases:

  • User with a content start node shows the content tree as it has always been - no context.
  • User with a group with a start node doesn't render a content tree at all.

The start node is Page 2 in both cases.

Shannon Deminick 05 Sep 2017, 08:38:13

@madsrasmussen If you only have a single start node, then there's no need for a context is there? That's how I've built it right now. It will only give you the full tree if you have more than one start node. I can change this if you like but doesn't seem like an outer context is required if you only have one starting place.

As for the blank tree, i'll have a look.

Shannon Deminick 05 Sep 2017, 14:56:26

@madsrasmussen have pushed an update:

  • It will only show nodes that exist within the branch of your own start nodes (as we discussed) so you won't see anything you shouldn't see except for ancestors of the nodes you can access

The blank tree is because you've selected a group that doesn't have Browse access to the nodes you are trying to view.

Let me know what you think about the single start node thing i mentioned above too

Mads Rasmussen 06 Sep 2017, 12:54:28

@Shandem Ah, you are right. I forgot the browse node permission, sorry about that.

I have done some more testing:

Content tree

  • Content tree works as described my only concerns at the moment are the state of a disabled node and the state of an unpublished node looks very similar. I think the main problem is that unpublished nodes should be more visible in the tree than just a lighter font-color, but I have no good solution for that now so let’s keep it this way.
  • The other one is what Andy mentions: The user has to click his way through a “disabled” tree when they visit the back office. I didn’t think of this before actually trying it out. I have made an experimental commit 😃 where I expand the tree to the first node which is not disabled. It works pretty well, but this might not be the best approach for larger sites. So I am open for suggestions how to do this the best way. If there is no good way, feel free to revert the commit and we can improve later.

Media tree

  • Media tree works as expected but I have some troubles getting the calculated media nodes on a user to show the correct nodes. See attached image.

I have fixed a couple of smaller issues: js error when saving the user, because of some changes to the reset password and showing the pointer cursor for the more menu item. (see commits)

And when testing this I found out that an URL on each start node would be very helpful (like we do with other content pickers), so I have added a task to get that fixed: U4-10390 I have added it to this sprint now but it is not super important for a 7.7 release.

Shannon Deminick 08 Sep 2017, 05:17:40


  • Regarding the grey/disabled color, i just picked one ;) so if you are ok with it for now that's fine by me!
  • I've fixed up the move/copy dialogs to not show the 'Content'/'Media' roots if the user has a start node assigned and no access to the root
  • I've fixed up searching in the dialogs which was totally broken (maybe a merge issue in js)
  • I've fixed up that media start node issue you saw
  • I love the auto expanding tree... it's a great addition!

If you can confirm thats all working lets get this one closed :)

Mads Rasmussen 10 Sep 2017, 16:05:31

My tests say that everything works. I will merge this is!

Yeah! :)

Priority: Normal

Type: Task

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.7.0

Sprint: Sprint 67

Story Points: 2