Members – Editing capabilities not listed by default

4 Replies ·

  1. Members is by far the most effective and attractive plugin for managing user roles and permissions that I have found to date, and I have used it in several sites now.

    I am having a recurring issue with it though: There are always capabilities which I need to edit for specific roles which do not show up on the list. These are always connected to other plugins rather than to WordPress core capabilities, but it is often necessary to remove some of these capabilities from accounts aimed at editors rather than admins.

    Can these capabilities be edited using the “Custom Capability” feature, and if so how is this done? I cannot figure out how to identify the ID or slug of the capability in question in order to add it.

    Thanks.

  2. Justin Tadlock

    The “Custom Capability” box on the side is for adding capabilities that do not already exist to a role. Once that capability is added to any role, it’ll always appear under both the “Custom” and “All Tabs” for all roles going forward.

    So, if you’re using a plugin that has a capability named do_something_cool, you simply type do_something_cool in the input box and click the “Add New” button.


    I hope that’s what you’re asking about. I was a little unsure because you kept referring to editing capabilities. You can’t “edit” capabilities, so it’s kind of throwing me off a bit reading your post. You can add a new capability (as described above). You can also grant or deny a capability to a role.

    I just want to make sure we’re on the same page. Using the correct terminology helps with that.

  3. MTM

    Yes, apologies – you can see that I’m acquiring this knowledge as I go here. I’m grateful for your patience.

    So, you are right – I am looking to add capabilities which I can then grant or deny to users according to their roles. What I am not sure how to do is identify the precise name of these capabilities, as referenced by your do_something_cool example.

    I realise that these are specific to the plugins in question, but my knowledge does not extend to locating the information.

  4. Justin Tadlock

    Figuring out the correct capability name (e.g., do_something_cool) is going to depend on the plugin. Any plugin that has custom capabilities should have those capabilities listed somewhere in the documentation. Otherwise, it likely doesn’t have any custom capabilities and is making use of those built into WordPress (manage_options is common).

    Now, some plugins will automatically integrate with Members, so that capability will appear somewhere on the Edit Role screen (depends on the plugin). Or, if the plugin adds a custom post type, Members will attempt to automatically add a custom tab for the post type.


    If you go to Settings > Members > General in your WP admin, you can disable the “Show human-readable capabilities when possible” feature if you want. That way, you’ll always see the true capability name when editing roles. This is typically what I do on my own sites.


    I’d be happy to look into any specific plugins that you’re using to see if I can find the right capabilities (if they exist). A lot of this does depend on the third-party plugin. Working on a specific problem tends to be a bit easier than general questions as well.

  5. MTM

    Justin, this is really helpful information, thanks. I’ll look into applying it over the next day or so and come back to you with any specific questions if I have them.