访问 Discourse WordPress 设置所需的 wp_capability 角色权限是什么?

Hi everyone,

I hope you are all doing great.
I have a developer that doe not have admin rights and needs to access this page:

I need to know which wp capability is the one needed to accomplish this.
We granted the capability of adding, editing and installing plugins!

Here is the screenshot displaying the issue.

Thank so much for the help.

Cheers!

support dev bug

Looking at Github, it would seem the capability used is manage_options.

https://github.com/discourse/wp-discourse/blob/master/admin/admin-menu.php#L51

7 个赞

Hello @RickU,

There are 2 ways to allow your developer to have access to this page, one is

Step 1: Install User Role Editor Plugin and create a custom role for your developer and assign manage_options capability, but this will also allow him to have access to admin related menus like settings, etc, so to avoid that, install Adminimize Plugin and remove admin menus for that particular role

Step 2: Create a user with the new role you have created and share the credentials with your developer.

Another is, add a custom code in your theme / child theme (if child theme is active) which will allow you to set custom capability for the Discourse admin menu access, create a custom role using code and assign the new capability to the role and create a user with the custom role and share the credentials with your developer, but in this method your developer can only see the page but can’t edit/update/save any changes, since manage_options capability is not provided which is required to save options in WordPress. If you want I can add the code on github and share the link here.

Try any of the above and let me know, :slight_smile:

5 个赞

I will be taking a look at this solution. It seem simple. I have been doing a lot of updates to our side and schedule has been crazy. I will update of the out come or route taken.

Thanks so much! :smiley:

挖出这个帖子

在最新版本中,是否有办法为特定用户角色授予对 WP Discourse 面板的访问权限?

听起来给他们完全的 manage_options 选项然后隐藏所有元素有点过头了。我们试图让我们的 wp 实例保持轻量级: (

访问情况与上述讨论保持一致。

你是否有你喜欢的、基于角色访问其管理面板的插件的示例,比如你建议的那种轻量级方案?我有兴趣改进这类功能,并希望了解存在的问题/期望的功能。

1 个赞

在我们的用例中,我们正在使用 Learndash LMS,并使用 WP Discourse 将他们的自定义帖子类型课程和主题发布到我们的论坛中。它有自己的讲师角色。虽然讲师可以编辑内容,但他们无法访问 WP Discourse 面板。