AppserverIo\Appserver\ServletEngine\Http\Request::isUserInRole PHP Метод

isUserInRole() публичный Метод

Return_s a boolean indicating whether the authenticated user is included in the specified logical "role".
public isUserInRole ( string $role ) : boolean
$role string The role we want to test for
Результат boolean TRUE if the user has the passed role, else FALSE
    public function isUserInRole(string $role)
    {
        // query whether or not we've an user principal
        if ($principal = $this->getUserPrincipal()) {
            return $principal->getRoles()->contains($role);
        }
        // user is not in passed role
        return false;
    }