Change WordPress user roles and capabilities Forums Give user access to plugin – how to Create User Role Restriction for Certain Widget Blocks

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2620
    heather
    Participant

    I’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?

    #2621
    heather
    Participant

    Following 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, 8983

    Other plugins that share the same Capabilities:
    Plugin: AGP Icons
    Capability: manage_options, edit_posts

    Plugin: 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?

    #2622
    heather
    Participant

    Okay, 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.

    #2623
    Vladimir
    Keymaster

    Thanks 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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.