src/modules/user/models/User.php
public function getRoleName ()
		{
			$auth = Yii::$app->getAuthManager();
			$roles = $auth->getRolesByUser($this->id);
			$role = current($roles);

			return $role ? $role->name : null;
		}
public function getRoleName ()
		{
			$auth = Yii::$app->getAuthManager();
			$roles = $auth->getRolesByUser($this->id);
			$role = current($roles);

			return $role ? $role->name : null;
		}
public function getRoleName ( ) { $ auth = Yii :: $ app -> getAuthManager ( ) ; $ roles = $ auth -> getRolesByUser ( $ this -> id ) ; $ role = current ( $ roles ) ; return $ role ? $ role -> name : null ; }
Gets user role.

@return string|null
Gets user role .