Dynamic role-based menu

Dynamic role-based menu

I would like to adjust the built-in menu, so that it only shows menu options for web screens a user can actually use.
In the properties of the web screen, at the bottom you have that checkbox list, where you set which role is allowed to use the web screen.
Is there a way to "query" or retrieve that information? I've looked in the database, but I'm affraid that data is not in the database, but semi-hardcoded into the application.
One could off course set up the menu manually, but that means you have to maintain 2 locations where those "access rights" are stored, which is really bad practice. When I allow a role to see a certain web screen, I want my menu to adjust automatically. Can this be done?
Hi, Tim.

In this topic (year 2009)

Rodrigo said: 
The association between Screens and Permission Areas is not stored in the metamodel. It is explicit in the generated code.

IMHO, the platform today has that same behavior.

Hope it helps you!

Daniel Martins.
Hi Tim,

You can go to Common\Menu, and add an IF on each tab.
You can use the 'Check Role' action under the Roles. There will be an action to validate each role that you have in your application (check the attached image).

You can also use the same logic, to only show links and other information on a screen if a user has a certain role.
@Daniel: That topic indeed confirms what I was affraid off.. no way to retrieve the info, unless you build an extra layer on top.

@João: I am aware of that option. It was the "set up the menu manually" option I mentioned at the bottom of my question. The big advantage of this system is that you need to maintain the access rights in 2 places, without any possibility to have a "link" between the 2. This is bound to go wrong at some point.

Thanks for thinking along, but I'm affraid I'll need to figure out some work-around, maybe playing with different Layout webblocks...