2 December 2019

User Roles who can access the admin.

1 vote

User Roles who can access the admin.

Hi There, I have checked in the code and see that users who have the permission ‘manage_options’ which is fantastic, but for users who do not have this permission still get access to a single DA Reactions button which takes them to the knowledge base here. How do i remove that or limit that to only those with ‘manage_options’ also? Its very annoying. Thanks Adam
Planned Chalkie shared this idea

2 thoughts on “User Roles who can access the admin.

  • Having gone through the code, its in relation to this specific set:
    $submenu[‘da-reactions’][30] = array(
    ‘ ‘ . __(‘Help’, ‘da-reactions’) . ”,
    ‘manage_options’,
    ‘https://www.da-reactions-plugin.com/knowledge-base/’,
    array(‘target’ => ‘_blank’)
    );

    Found in: da-reactions-premium/classes/DaReactions/Admin.php

    I am pretty sure it’s because the capability restriction is not being loaded correctly, I remove it completely so to fix the conflict, it has removed the ‘help’ part of the menu but we have it running exactly how we would like.

    If this could be fixed in an upcoming update it would be grand.

    Adam

  • Thank you for your feedback, I guess that I will nest that instruction inside a block like this:

    if (current_user_can( 'manage_options' )) { ....... }

Leave a Reply

Your email address will not be published. Required fields are marked *

2 thoughts on “User Roles who can access the admin.

  • Having gone through the code, its in relation to this specific set:
    $submenu[‘da-reactions’][30] = array(
    ‘ ‘ . __(‘Help’, ‘da-reactions’) . ”,
    ‘manage_options’,
    ‘https://www.da-reactions-plugin.com/knowledge-base/’,
    array(‘target’ => ‘_blank’)
    );

    Found in: da-reactions-premium/classes/DaReactions/Admin.php

    I am pretty sure it’s because the capability restriction is not being loaded correctly, I remove it completely so to fix the conflict, it has removed the ‘help’ part of the menu but we have it running exactly how we would like.

    If this could be fixed in an upcoming update it would be grand.

    Adam

  • Thank you for your feedback, I guess that I will nest that instruction inside a block like this:

    if (current_user_can( 'manage_options' )) { ....... }

Comments are closed.