Discussions
Easiest way to retrieve roles for username
about 6 years ago by Troy Dahnert
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.