dongxiezhi0590 2019-01-28 20:18
浏览 25

限制访问我的WP作业管理器应用程序功能

I would like to restrict access to my WP job manager applications add-on, using the function to only allow the developer 'role' to apply for jobs. I added the code found on your Applications: Limiting applications to a certain role, link below;(https://wpjobmanager.com/document/applications-limiting-applications-certain-role/).

As stated in the above link, I added the below code to my site’s application form.php.

At the top of the file add:

 <?php if ( current_user_can( 'candidate' ) ) : ?>

I Replace ROLE with my desired role ‘candidate ’.

At the end of the file add:

 <?php else : ?>
 Please login as a Developer to apply for this position.
 <?php endif; ?>

The problem is that this has not blocked the employer from applying for jobs, where it is supposed to bring up the restricted content message; "Please login as a Developer to apply for this position."

I have been doing more testing on the above code with a few different roles to see if this makes a difference,

See the outcome below regarding the different roles and who gets access;

Example 1 - current_user_can (candidate) Candidate role - can access the application function Subscriber role - no access, gets correct message (Please login as a Developer to apply for this position) Employer role - can access the application function

Example 2 - current_user_can (subscriber) Subscriber role - can access the application function Candidate role - - no access, gets correct message (Please login as a Developer to apply for this position) Employer role - can access the application function

Example 3 - current_user_can (employer) Employer role - can access the application function Candidate role - - no access, gets correct message (Please login as a Developer to apply for this position)
Subscriber role - no access, gets correct message (Please login as a Developer to apply for this position)

So what I want to find-out why the Employer role can still view the application process on all options? How can I block them from applying for jobs, as they are only supposed to be able to post jobs on the site, not apply.

Looking forward to your response.

Regards;

Greg

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度