How to retrieve user role(s) in oxwall?

46 views Asked by At

I can retrieve some very basic data with:

OW::getUser()->getUserObject()

But I have no idea how to retrieve roles an user belongs to. Any idea ?

1

There are 1 answers

0
Ebenezer Obasi On

Use the authorisation service class. See example below:

// list user roles of currently logged in user
$userId = OW::getUser()->getId(); // get current user Id
BOL_AuthorizationService::getInstance()->findUserRoleList($userId); // list user roles