I would like to get the Role of the user logged in.
I’m trying to use the vendormagentomodule-userModelUser.php
class, but all results give me null or empty.
I’m trying to use vendormagentomodule-authorizationModelRole.php
, but the same happens, all empty.
I have achieved getting the userName of the user logged in, which might help, with this class: vendormagentomodule-backendModelAuthSession.php
I have checked the database, and in the authoritzation_role
I have:
Where the parent_id
refers to the 3 roles I have created:
What am I doing wrong here? Am I calling the right classes? Is there a better way to do it?