public function check_access($id) {
        $instance = $this->get_block_instance($id, IGNORE_MISSING);
        if (!$instance) {
            // This generally won't happen because if the block has been deleted then we won't have
            // included its context in the search area list, but just in case.
            return manager::ACCESS_DELETED;
        }

        // Check block has not been moved to an unsupported area since it was indexed. (At the
        // moment, only blocks within site and course context are supported, also only certain
        // page types.)
        if (!$instance->courseid ||
                !self::is_supported_page_type_at_course_context($instance->pagetypepattern)) {
            return manager::ACCESS_DELETED;
        }

        // Note we do not need to check if the block was hidden or if the user has access to the
        // context, because those checks are included in the list of search contexts user can access
        // that is calculated in manager.php every time they do a query.
        return manager::ACCESS_GRANTED;
    }
public function check_access($id) {
        $instance = $this->get_block_instance($id, IGNORE_MISSING);
        if (!$instance) {
            // This generally won't happen because if the block has been deleted then we won't have
            // included its context in the search area list, but just in case.
            return manager::ACCESS_DELETED;
        }

        // Check block has not been moved to an unsupported area since it was indexed. (At the
        // moment, only blocks within site and course context are supported, also only certain
        // page types.)
        if (!$instance->courseid ||
                !self::is_supported_page_type_at_course_context($instance->pagetypepattern)) {
            return manager::ACCESS_DELETED;
        }

        // Note we do not need to check if the block was hidden or if the user has access to the
        // context, because those checks are included in the list of search contexts user can access
        // that is calculated in manager.php every time they do a query.
        return manager::ACCESS_GRANTED;
    }
public function check_access ( $ id ) { $ instance = $ this -> get_block_instance ( $ id , IGNORE_MISSING ) ; if ( ! $ instance ) { // This generally won't happen because if the block has been deleted then we won't have // included its context in the search area list, but just in case. return manager :: ACCESS_DELETED ; } // Check block has not been moved to an unsupported area since it was indexed. (At the // moment, only blocks within site and course context are supported, also only certain // page types.) if ( ! $ instance -> courseid || ! self :: is_supported_page_type_at_course_context ( $ instance -> pagetypepattern ) ) { return manager :: ACCESS_DELETED ; } // Note we do not need to check if the block was hidden or if the user has access to the // context, because those checks are included in the list of search contexts user can access // that is calculated in manager.php every time they do a query. return manager :: ACCESS_GRANTED ; }
Checks access for a document in this search area.

If you override this function for a block, you should call this base class version first
as it will check that the block is still visible to users in a supported location.

@param int $id Document id
@return int manager:ACCESS_xx constant
Checks access for a document in this search area .