I'm trying to get the role of a user in a beforeSave hook. I can get the userId from the assignedUserId of the entity, and then use that to query for the user by ID, but I can't seem to find a way to get a list of roles or role names (I really need the latter) once I have a user. I expected something like $user->get('roles') or $user->get('rolesIds') to work but haven't had any luck.
Announcement
Collapse
No announcement yet.
How to get the role of a user in a beforeSave hook
Collapse
X
Comment