3 weeks ago
Good afternoon community. I have an MDK application in which I need to access the roles of the logged in user to know which buttons or screens to show. I am making a basic example trying to show or hide a particular button. This role is linked to a rule.
Now I'm just printing a string in the app that returns me useful information. But in roles I only see an array with a single string called "openid".
I was expecting to see the "Admin" role which I added to my user, but I don't see it. Here's how I have it configured. This is the logic of what you are seeing:
I know that the role works because I am getting information from my CAP service that the Admin role needs. My problem now is how to access the list of roles that the user who logged in has so that I can use that information to my advantage and be able to show certain information to the users within the application. I appreciate any information you can provide me.
Hi @emorales
I'm sharing one way of doing it if the backend role plays a significant part in your application’s logic.
Fetching Role Information:
Using Role Information:
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
11 | |
10 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.