Note that child roles that are not assigned directly to the user will not be returned.
public getRolesByUser ( string | integer $userId ) : |
||
$userId | string | integer | the user ID (see [[\yii\web\User::id]]) |
return | all roles directly assigned to the user. The array is indexed by the role names. |