Viewing 15 replies - 1 through 15 (of 25 total)
  • Thread Starter aspacecodyssey

    (@aspacecodyssey)

    EDIT: Scratch that, it’s a “roles” problem. I am using the “Members” plugin and it’s any *created* non-admin role (i.e. it works for the other default roles). Still, is there a fix?

    Thread Starter aspacecodyssey

    (@aspacecodyssey)

    EDIT AGAIN: Line 7 in lib/generator.php makes this plugin incompatible with any custom created role.

    if ( !current_user_can( 'author' ) && !current_user_can( 'editor' ) && !current_user_can( 'administrator' ) )

    This means only those 3 user roles can use the plugin. Removing the line completely or adding your custom role to the list will fix it, however this is not permanent because a plugin update will nix this fix. I’m not sure what the proper fix would be.

    I had the same problem, can someone contact the author ?

    This have no sense, I’m using a custom role, also, as explained in the codex.

    This is the only plugin giving me problems, there is no reason in “hardcoded” authorization checks.

    Plugin Author Vova

    (@gn_themes)

    Sorry guys, absolutely have no time to make updates/fixes.
    You can fix it yourself as described in post above

    if ( !current_user_can( 'author' ) && !current_user_can( 'editor' ) && !current_user_can( 'administrator' ) )

    Next version (4.0.0) will have option at settings page to setting up roles.

    Hi gn_themes. Thank you for the fast answer.

    First: The solution works, we’ll look into the next release, but please don’t make the same mistake (making it impossible to use custom roles as now).

    For example big plugins like Nextgen Gallery and WooCommerce have the possibility of “forcing capablities definition”, in this way:
    add_role(‘cliente’, ‘Cliente’, array(
    ‘NextGEN Manage gallery’ => true,
    ‘manage_woocommerce’ => true,
    ));

    Please keep in mind that this “keys” must be defined into your code plugin, don’t know exactly how, but it’s related to the moment in wich you create the page into the WP menu.

    IMHO, a plugin like yours should be just avaiable to whoever can “edit_posts” and “edit_pages”.
    Give a look to “tiny mce advanced” about that purpose, it does same thing.

    Second: please consider this advices: https://www.ads-software.com/support/topic/you-should-add-in-next-versions?replies=1#post-3769045

    Plugin Author Vova

    (@gn_themes)

    There is fixed version of lib/generator.php – https://pastebin.com/raw.php?i=bMAAhiU0

    Replace your file with this code and all logged users will can use shortcodes generator.

    Plugin Author Vova

    (@gn_themes)

    >> Please keep in mind that this “keys” must be defined into your code plugin, don’t know exactly how, but it’s related to the moment in wich you create the page into the WP menu.

    Sure, I know that. WP has methods to get all registered user roles. I’ll use that methods in next version.

    Plugin Author Vova

    (@gn_themes)

    >> Second: please consider this advices: https://www.ads-software.com/support/topic/you-should-add-in-next-versions?replies=1#post-3769045

    Thank you for the awesome suggestions. I have already added some of these ideas to my todo list.

    Perfect !

    I’ll look into that code and write to NextGen new developers,
    they still have users “base types” hardcoded into php code.

    p.s. for your specific plugin, however, I honestly think you could put custom user roles in the end of your to do list, of course while you fix the actual problem cheking only for is_user_logged_in()

    I started experiencing this problem a week or so ago. Version 3.9.5 with WP 3.6.1 (currently upgrading).

    As suggested changing line 7

    if ( !is_user_logged_in() ) die( 'Access denied' );

    to

    if ( !current_user_can( 'author' ) && !current_user_can( 'editor' ) && !current_user_can( 'administrator' ) )

    resolved my problem.

    I am a super admin for a WPMU network and my role and editor role were denied permission.

    Thank you for the helpful information.

    Plugin Author Vova

    (@gn_themes)

    This problem is solved in new beta version. You can try it yourself. GitHub repo. Direct download link.

    Don’t forget to deactivate old version before activating new.

    I installed the beta and have deactivated the old version.

    However, I don’t see the option in Settings to setting up roles.

    I need to be able to restrict access to the shortcodes for a certain group.

    Plugin Author Vova

    (@gn_themes)

    You can now install version 4.1.0 from wporg repository. Access for shortcodes is granted only for users that can edit posts.

    Plugin Author Vova

    (@gn_themes)

    This option is not needed in current plugin version.

    I need to be able to restrict certain roles from accessing the shortcodes (they are not very technical and will mess up their posts).

    I use the Members plugin and it has the ability to add in a custom classification such as:

    create_role
    edit_posts
    gravityforms_edit_forms

    Does your plugin have similar names?

    If not, then any suggestions?

    Thanks.

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Non-Administrators "Access Denied"’ is closed to new replies.