Automattic / WP-Job-Manager

Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.
https://wpjobmanager.com
GNU General Public License v3.0
900 stars 368 forks source link

Employers can create a Resume and apply for jobs #2790

Closed tobias992 closed 6 months ago

tobias992 commented 6 months ago

Describe the bug If I register as an employer and use the application function (Resume-Manager), employers can also create a resume and apply for jobs. I don't think that should be the case.

To Reproduce

  1. Register as employer
  2. Open your own job listing
  3. Use application form (Resume-Manager)
  4. You will be redirected to create resume form

Expected behavior Employers shouldn't see the application forms in single job pages.

Isolating the problem (mark completed items with an [x]):

WordPress Environment

gikaragia commented 6 months ago

Hey @tobias992 by default, Resume Manager does not hide the resume from anyone unless the setting to require an account is enabled and the user is not logged in.

With that said, you can achieve what you are asking with a code snippet that uses the resume_manager_user_can_post_resume filter. Something like this (haven't actually tested it):

function do_not_allow_employers( $can_post ) {
    $user = wp_get_current_user();
    if ( in_array( 'employer', (array) $user->roles ) ) {
        return false;
    }
    return $can post;
}

add_filter('resume_manager_user_can_post_resume', 'do_not_allow_employers');