0

When blocking access for a editor role to the view admin/content, all sub-items of the toolbar content item are not visible to this role. How to solve this ?

3
  • Isn’t it because they are child items of that route?
    – Kevin
    Commented Jun 1, 2018 at 12:57
  • Yeah, the link is hidden because the user doesn't have access so no children of the link appear either.
    – sonfd
    Commented Jun 1, 2018 at 12:59
  • indeed but what if i dont want to give access to that view but permit to add content?
    – Matoeil
    Commented Jun 1, 2018 at 12:59

1 Answer 1

1

You can add a new menu link to act as the parent of all the items, a menu link that the users will have access to, then move the Content sub items underneath it. Or you could just move them out from underneath the Content menu item, but that'll probably make a messy toolbar. The toolbar just shows part of the Administration menu, all items under the Administration menu link.

4
  • so the permission will add automatically the corresponding link , even if the parent is not admin/content anymore?
    – Matoeil
    Commented Jun 1, 2018 at 13:04
  • 1
    I wouldn't really word it like that, but if you move the menu links, and you have permission to view the page their pointing to, they will appear in the menu.The permission doesn't "add" the link, it just allows it to be seen or not seen. The link is always in the menu, but it's not rendered if the user doesn't have permission to view the page. In this case the children items aren't shown simply because they appear as children of a link that points to a page they don't have access to.
    – sonfd
    Commented Jun 1, 2018 at 13:54
  • and how to make this custom parent link only visible if there is item to it ?
    – Matoeil
    Commented Jun 1, 2018 at 14:14
  • I'm not sure I fully understand, but maybe just have the parent point to the /node/add page. Assuming you don't have Media or other entity links that appear under the Content link, then I think that should work how you'd like.
    – sonfd
    Commented Jun 1, 2018 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.