Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

User role/group from API


#1

Is there any way to get a user’s role or group from the API?


#2

Hello Logan,

Thanks for your posting. Role or group details are currently not supported via the API. It would be supported to read this by accessing the database directly (which is supported for read-only queries) but I’m not sure if this would be an option for you (I’m happy to provide additional details in this case).

Regards,
Tobias


#3

Hi,

I would need the detail please.

Thanks.


#4

Hello Alston,

Thanks for your posting! The roles and groups are stored in two separate tables, conveniently named roles and groups :slight_smile:

So to get all roles or groups via SQL, you can use:

SELECT * FROM roles;
SELECT * FROM groups;

The groups for a user are stored in group_users. To find out the groups for a user with ID 10, you can use:

SELECT * FROM group_users WHERE user_id = 10;

Important: please note that we only support accessing the database for read-only queries.

I hope this helps!

Cheers,
Tobias


#5

Dear Tobias

Thanks for the detail.

Alston


#6

You are welcome, Alston, and please let me know in case you have any further questions!

Cheers,
Tobias