Doesn't work with navigation bar

Created on 8 October 2024, about 1 month ago

Problem/Motivation

The menu access roles doesn't work if the menu is added to the navigation bar

Steps to reproduce

1- Enable core module "Navigation"
2- Create a new menu
3- Change the layout of any page to use the navigation layout
4- Add some role access to menu items after enabling this module
5- Add the menu navigation block to the navigation section of the page

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇦🇺Australia rmasoad@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rmasoad@gmail.com
  • 🇬🇧United Kingdom LiamPower

    Hi rmasoad@gmail.com

    I've followed your steps to replicate, but I'm not able to replicate this issue - Do you by any chance have the `link to any page` permission on the account you were trying this on? Either that or I have misunderstood part of your steps to reproduce.

    1- Enable core module "Navigation"
    2 - Enable "Menu item role access"
    3- Create a new menu "Custom menu"
    4- Include the new "Custom menu" block as part of the navigation bar (/admin/config/user-interface/navigation-block)
    5- Add a new menu item to the "Custom menu" and add the anonymous role to the menu item
    6- Check page displaying the new navigation.
    7- Menu item does not display - Menu item not there
    8- Remove role permission from the menu item.
    9- Menu item now displays for admin user.

  • 🇬🇧United Kingdom LiamPower
  • 🇱🇧Lebanon yara mezher

    Hello,

    The issue might not be related to the 'Navigation module', but perhaps related to the point mentioned in https://www.drupal.org/project/menu_item_role_access/issues/3270866 🐛 change of user role has no effect on menu items access without a cache purge Needs review comments #4 and #7

    'The check is never performed for any menu item with an internal route, unless you have configured to Overwrite the default access check' in the module configuration in /admin/config/menu-item-role-access

    rmasoad@gmail.com , can you try enabling this option and see if it solves the problem for you?

Production build 0.71.5 2024