...
In this example, a menu entry name FAQ will display HTML page called “our-lms-faq” when the site is viewed in English and the user is logged in.
Restricting Access to a Menu
The Custom menus can be created so that they are only accessible to a specific group of users such as registered users. You add this parameter as the last option on a menu entry to restrict access to specific user groups. Some common access restrictions areitems will be visible to all users, including users who haven't logged in, unless you restrict access to them by specifying required capabilities.
A common requirement is to show different menus to authenticated users and non-authenticated users. To facilitate this requirement, you should be aware of the following common capabilities:
User Group | Menu Option |
---|---|
Logged in users only | local/dualcode:authenticated |
Non-logged in users only | local/dualcode:notauthenticated |
Anyone with editing privileges on the site | local/pages:manage |
Everyone | no option is required |
For an exhaustive list of permissions, see Note: When a custom menu item is associated with local/dualcode:authenticated, users will need to log into the system to see it. Likewise, when a custom menu is associated with local/dualcode:notauthenticated, users will see the menu item so long as they have not signed into the application.
Any capability in the system can be used to restrict access to a menu item. For an exhastive list of capabilities, see https://docs.moodle.org/2531/en/Category:Capabilities.
Creating Submenus
Submenu entries are created by putting a dash “-“ at the start of the line. For example:
...