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;
    }
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;
    }
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 ; }
Return_s a boolean indicating whether the authenticated user is included in the specified logical "role".

@param \AppserverIo\Lang\String $role The role we want to test for

@return boolean TRUE if the user has the passed role, else FALSE
Return_s a boolean indicating whether the authenticated user is included in the specified logical role .