How to block access to certain WordPress pages using a snippet

Try this, assuming that job_posting_access is a valid hook defines by some plugin:

add_action( 'job_posting_access', function() {

    // $pages is  Page ID, title, slug, or array of these for which access is restricted

    $pages = ( array ('page 1', 42, 'page-2')  );

    if ( ! current_user_can( 'employer' ) && is_page( $pages ) ) 

          wp_die('<div class="job-manager-error">Sorry, you do not have permission to post jobs.</div>');

}