with:
$userRole = yii::$app->authManager->getRolesByUser($userId);
got the array:
$userRole = Array
(
[author] => yii\rbac\Role Object
(
[type] => 1
[name] => author
[description] =>
[ruleName] =>
[data] =>
[createdAt] => 1437713730
[updatedAt] => 1437713730
)
)
want to just get a string:
the value of the $userRole is 'author'.
without using: $userRole = array_keys(yii::$app->authManager->getRolesByUser($userId))[0]