• Resolved nigel01

    (@nigel01)


    Hi:

    Is there a way to use the ‘wand’ functions in Gutenberg (generate titles, excerpts etc.) while logged in with AUTHOR capabilities. Right now it doesn’t seem to like it – returning a message that says “Error: Sorry, you’re not allowed to do that”

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter nigel01

    (@nigel01)

    Looking at the code it looks like it’s checking for roles instead of capabilities. It’s checking for the ‘editor’ role which means that custom roles cannot be defined and used with the plugin.

    In the function can_access_features(), please consider checking for a capability instead such as ‘edit_posts’?

    Similar for administrator – instead of checking for the ‘administrator’ role in the can_access_settings() function, maybe check for something like ‘manage_options’ or the super admin capability (multisite)?

    Thanks.

    Plugin Author Jordy Meow

    (@tigroumeow)

    @elect2all, I asked a moderator to check if you are spamming or not. I don’t think it helps anyone and it also seems completely unrelated. It’s also your second message on this forum within a few minutes about this same service (https://www.ads-software.com/support/users/elect2all/replies/). You are not supposed to do that.

    Hi @nigel01! The can_access_features and can_access_settings are actually two functions I am using on all my plugins, in the same way, and it has been working really well like this. Each of them have a related filter (mwai_allow_setup and mwai_allow_usage). Why not overriding the behavior of those functions via those filters? You can basically control it completely the way you like. As a side note, I might change the name of those functions, but not the filters.

    Thread Starter nigel01

    (@nigel01)

    Hi @tigroumeow:

    Yup, using the filters is exactly what I did to handle the issue I was trying to resolve. But unless someone digs into the code they wouldn’t know the filters exist. In that case they’ll be stuck with using WP built in roles instead of being able to define their own custom roles.

    Seems a shame to not allow admins to be able to use the roles-and-capabilities system flexibly the way it was designed.

    Happy to push a PR for it since I’m sure you’re busy – I just don’t know if there’s a public git repo somewhere.

    Thanks.

    Plugin Author Jordy Meow

    (@tigroumeow)

    Don’t worry, I know exactly to code this your way as well ?? But I still prefer the way I did it (as the default settings), it’s safe and use throughout all my plugins. Actually, there is some info about this in my documentation, so quite often, those filters are used. I need to be careful with this kind of changes as they would impact lot of users. Nice day to you, and thanks for your feedback ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Min Capabilities for User?’ is closed to new replies.