Nayax Core has a role management system that lets administrators control what users can see and do based on their role. You can connect your Core Extension to this system so that specific UI elements in your app (tabs, buttons, widgets, settings sections) are automatically shown or hidden based on the logged-in user’s role. Your app fetches the list of hidden elements from Nayax at startup, then applies visibility throughout your UI.Documentation Index
Fetch the complete documentation index at: https://devzone.nayax.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Your Core Extension is registered with Nayax and has a model name (for example,
Apps/YourAppName) - You have identified the UI elements in your app that should be role-controllable
Define your UI element IDs
Assign a string ID to each UI element you want to make role-controllable. Use this naming convention:Keep a list of all element IDs you define. You will provide this list to Nayax so administrators can configure role permissions for each one.
- Category: one of
tab,widget,action,settings,sidebar,topMenu - Name: camelCase identifier for the element
Element IDs are case-sensitive. Use consistent casing throughout your app and in the list you submit to Nayax.
Fetch hidden elements at startup
When your app loads, call the Nayax UI elements endpoint to get the list of elements that should be hidden for the current user:The endpoint returns a JSON object with a Store the result as a set for fast lookup:
hide array:The endpoint returns an empty
hide array for users who can see everything (for example, administrators). An empty array is a valid response, not an error.Apply visibility in your UI
Create a helper function that checks whether an element should be visible, then use it throughout your UI before rendering each role-controllable element:Call Then apply visibility checks in your UI:
fetchHiddenElements at app startup and store the result before rendering:Handle the loading state
The API call takes time. Decide how your app behaves while permissions are loading. The safest approach is to render nothing until the API call resolves, then apply visibility:Alternatively, you can render all elements immediately and re-render after permissions load. Either approach is valid, but the first avoids a flash of visible content.
Element ID naming reference
Use these categories when defining your element IDs:| Category | Use for |
|---|---|
tab | Tabs in a tabbed view (for example, tab.overview, tab.reports) |
action | Buttons or menu items that trigger an operation (for example, action.export, action.delete) |
widget | Dashboard cards or data panels (for example, widget.salesChart) |
settings | Sections within a settings screen (for example, settings.notifications) |
sidebar | Sidebar navigation items (for example, sidebar.filters) |
topMenu | Items in a top navigation bar (for example, topMenu.userMenu) |
Error handling
The UI elements endpoint is designed to fail open. If the request fails for any reason (network error, authentication issue, server error), your app should show all elements rather than hiding everything. Hiding elements when you cannot confirm permissions would lock users out of your app. The example in Step 2 implements this behavior by returning an emptySet on any error.
Troubleshooting
If role-based visibility is not behaving as expected, use the table below to identify the cause.| Symptom | Likely cause | Fix |
|---|---|---|
| All elements visible despite role configuration | API returned empty array or request failed | Check browser DevTools network tab for the /core/apps/ui-elements response |
| Specific element not hiding | Element ID not in the hide array | Verify your element ID matches exactly what Nayax configured (case-sensitive) |
| API returns 404 | App not served through reverse proxy | Access your app through Nayax Core, not directly |
| Element IDs not available in role management | IDs not submitted to Nayax | Provide your element ID list to Nayax for registration |
What’s next
Translations
Expose your UI strings for multi-language support.
Authentication
Understand the JWT token your app receives from Nayax.