Lifery DXP 7.4: getting site role with /o/api services

thumbnail
Alessandro Candini, modified 3 Years ago. Regular Member Posts: 130 Join Date: 10/17/15 Recent Posts

Hi everyone, I have an user, belonging to a UserGroup and this UserGroup is associated to a site Role.

Using a sequence of Liferay REST API calls, how can I get which site role have my user?

I would like to get my user data, but inside the JSON returned I do not have neither site roles, nor site groups which it belongs to.

Calling the user group API, I do not have the list of users belonging to them, neither roles associated to that group.

Finally, calling the site this user belongs to, there is no reference to site roles.

How to manage this? What is the supposed correct sequence of calls?

Thank you.

Jamie Sammons, modified 10 Months ago. New Member Post: 1 Join Date: 7/26/21 Recent Posts

Hello Alessandro,

You can try the headless-admin-user API: http://localhost:8080/o/headless-admin-user/v1.0/openapi.yaml

To get the user info, try: 

curl "http://localhost:8080/o/headless-admin-user/v1.0/my-user-account" -u "test@liferay.com:test"

or

curl "http://localhost:8080/o/headless-admin-user/v1.0/user-accounts/{accountId}" -u "test@liferay.com:test"

Hope this helps