These docs are for v20.3.44. Click to read the latest docs for v20.3.186.

Discussions

Ask a Question
Back to All

Easiest way to retrieve roles for username

I'm trying to retrieve roles for a given username. The User entity has a roles field, but this is always null regardless of whether the user has been assigned any roles. I know that I could get a userkey for a username, then query UserRole to get a list of RoleKeys, then use rolekeys to get the names of the roles, but it seems like there should be a more straightforward way to get this information.