Sometime I just want to know if a user has a certain role or not. Especially for the current authenticated user.
One can use Yii::$app->authManager->getRolesByUser($user_id) to get the roles and then loop through them to find out if the user has got the role. But it could already part of the BaseManager (abstract or base implementation, and finally implemented in PhpManager and DbManager) with a method like userHasRole($user_id, $role) which returns true or false.
Even better would be Yii::$app->user->hasRole($role). Is this possible?
This could result in better performance - e.g. the DbManager could use better queries.