public function hasRoleWithName(string $role): bool
    {
        $this->compileUserRoles();

        return in_array($role, $this->userRoles);
    }
public function hasRoleWithName(string $role): bool
    {
        $this->compileUserRoles();

        return in_array($role, $this->userRoles);
    }
public function hasRoleWithName ( string $ role ) : bool { $ this -> compileUserRoles ( ) ; return in_array ( $ role , $ this -> userRoles ) ; }
Check if the current user has a given role.

@param $role

@return bool True if the role fits, false if there is no user or the role is not accessible in the hierarchy
of existing user roles.
Check if the current user has a given role .