How to set Role to Submenu folder

Is there a way to set Role to submenu folder in Menu, so the child menu items are hidden, if user doesn’t have relevant role?

Currently not. The reason is it would be a bit risky.

Consider the following scenario:

  1. An application is deployed initially with 3 menu items in the submenu.
  2. The admin assigns the submenu-level application role, so the user sees all 3 menu items just by assigning the single application role.
  3. A new version is deployed, 4th menu item is added by a developer to the submenu.
  4. Now the user automatically sees the 4th menu item even though nobody assigned it (it is displayed because of the submenu-level application role).

If the permissions are set on a menu item level, you have a full control on what users see and a new application version does not automatically mean users will be exposed to the new menu items.

And is there a way to hide the submenu when it contains menu items with a specific role, so that an empty folder is not visible to users without that role?