Create Navigation (Menu) through a API

0
Hello there,I am a mendix new bee and jsut started learning using Studio pro 10.24.4I seeking help to know if there is an API that I can call to create / update User Roles under the App Security component?If yes, please point me in the right direction for any availablt documentations.If not, any ideas on how this can be achieved would be really great.Apprecaite the community. TIA.Attaching a screenshot for reference:BestVarshan
asked
2 answers
2

Hi Varshan,

If your requirement is to create or update the App Security navigation (menu) or User Role definitions through an API at runtime, that isn't supported.


Navigation menus and App Security → User Roles are design-time configurations stored in the Mendix model, so they can't be created or modified through a runtime API.


If your goal is to show different menus dynamically, a common approach is to create your own dynamic navigation entity (for example, Menu, MenuItem, and UserRole associations), populate it through an API, and render it using a List View or Gallery with role-based visibility. This gives you API-driven navigation without modifying the actual App Security configuration.


If your requirement is specifically to assign existing roles to users instead, that's a different approach and can be done using System.UserRole.


Kindly mark this as the accepted answer if it helps.

answered
0

Hi Varshan

Can you please clarify your question.


As far I can understand,

In mendix user roles are defined in design time

The are Defined in Studio Pro ->App Security then the User Roles compiled into the runtime .mdr file
They are not database records.


The entity System.UserRole store the user roles, so you can assign/unassing user roles to existing user.

But can not create new user role at runtime.


My question is do you want to assign existing roles to users, or literally create new role definitions?

answered