Change WordPress user roles and capabilities › Forums › Give user access to plugin – how to › Create User Role Restriction for Certain Widget Blocks
- This topic has 3 replies, 2 voices, and was last updated 9 years, 2 months ago by
Vladimir.
-
AuthorPosts
-
11/08/2016 at 16:55 #2620
heather
ParticipantI’m using the plugin WYSIWYG Blocks and need to create a User Role restriction so the user can access only certain Widget Blocks.
Does anyone here have experience with creating this type of restriction?
11/08/2016 at 18:23 #2621heather
ParticipantFollowing these instructions: https://www.role-editor.com/block-wordpress-admin-menu-items/
I was able to get a role to access certain Widget Blocks. Unfortunately, the plugin that I gave access to this role shares the same capability. So now I have two more plugins accessible by this role that share the same capability, but I don’t want this role to get access to these plugins.
So how do I exclude these other plugins that share the same capability and still give access to the role to only the Widget Blocks?
For example,
Role: IT
Plugin: Widget Blocks
Capability: edit_posts, create_posts (I selected the following: edit_posts, edit_others_posts—this had to be selected–,create_posts, edit_published_posts)
Posts edit: 8981, 8983Other plugins that share the same Capabilities:
Plugin: AGP Icons
Capability: manage_options, edit_postsPlugin: Meta Slider
Capability: I don’t know because I can’t see it listed in the Admin Menu. So obviously this must share a capability.So how do I get rid of access to AGP Icons and Meta Slider for this role?
11/08/2016 at 18:29 #2622heather
ParticipantOkay, so I went to Settings > User Role Editor > ‘Force custom post types to use their own capabilities’ and was able to refine the role’s access to certain items.
This worked very well.
12/08/2016 at 01:06 #2623Vladimir
KeymasterThanks for sharing your experience.
In general if plugins use the same capabilities you may block unneeded plugin menus via “Admin menu access” add-on you referenced at your post.
Some plugins changes capabilities, which they use for menu protection, dynamically:
use one for ‘administrator’ role and another one for other roles. Such cases require investigation as the admin menu access module shows menu items list using capabilities it got from menu for the ‘administrator’ role. -
AuthorPosts
- You must be logged in to reply to this topic.