private function hasRole($role) {

        if (substr($role, 0, 4) !== 'urn:')
        {
            $role = 'urn:lti:role:ims/lis/' . $role;
        }

        return in_array($role, $this->roles);

    }
private function hasRole($role) {

        if (substr($role, 0, 4) !== 'urn:')
        {
            $role = 'urn:lti:role:ims/lis/' . $role;
        }

        return in_array($role, $this->roles);

    }
private function hasRole ( $ role ) { if ( substr ( $ role , 0 , 4 ) !== 'urn:' ) { $ role = 'urn:lti:role:ims/lis/' . $ role ; } return in_array ( $ role , $ this -> roles ) ; }
Check whether the user has a specified role name.

@param string $role Name of role

@return boolean True if the user has the specified role
Check whether the user has a specified role name .