• Resolved jwright006

    (@jwright006)


    Greetings –

    I have been debugging an issue where I disable “manage_options” permissions for my Shop Manager role and it keeps getting re-enabled. I’ve deactivated all of my installed plugins and re-activated 1-by-1 and it seems that my “Order Delivery Date for WooCommerce (Lite version)” plugin, Version 3.5, is the culprit.

    Can you please look into why activating the plugin re-enables the manage_options permission for the Shop Manager role?

    I’m running WordPress 4.9.6 and WooCommerce 3.4.1.

    Thanks,
    Justin

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter jwright006

    (@jwright006)

    A bit more info… it seems this was added purposely in 2.2 via the following code:

    /** 
      * Capability to allow shop manager to edit settings
      * 
      * @hook admin_init
      * @since 2.2
    */
    function orddd_lite_capabilities() {
        $role = get_role( 'shop_manager' );
        if( '' != $role ) {
          $role->add_cap( 'manage_options' );
        }
    }

    It seems to me the intent of the above was to enable the Shop Manager role to be able to adjust the delivery date settings, however rather than honor the Shop Manager role it instead modifies the permissions of the role itself, which of course has implications much broader than just this plugin.

    I think it would be best of a plugin doesn’t modify ( especially upgrade ) the permissions associated with a role. Could this capability be re-assessed?

    Thanks again,
    Justin

    • This reply was modified 6 years, 6 months ago by jwright006.
    Plugin Support dhara61

    (@dhara61)

    Hi Justin,

    Thank you so much for raising your query with us. We are always there to help you with your problems.

    Regarding the Requirements:

    From my understanding, I think you mean is on activating our plugin it re-enables the ‘manage_options’ permission for the Shop Manager role even if it is disabled.

    If yes, then we have done it purposely, as many of our clients were asking for the same i.e. to offer the editing rights for the settings in our plugin by shop manager.

    Thus, on changing the role of the ‘Shop Manager’ our plugin will automatically re-enable the ‘manage_options’ permission.

    For your reference:

    If you want you can edit the code of our plugin in order to achieve your requirement at your end. We cannot change that from our side because if we do so then it will impact our other clients. We hope you understand.

    Also, if you make any changes in the code of our plugin then make sure you don’t update our plugin and if at all in future you update our plugin then make sure you have to edit the code once again after updating our plugin else, the changes won’t reflect on your site.

    We hope the provided information was helpful to you. Have a great day ahead. ??

    Thread Starter jwright006

    (@jwright006)

    Thank you for the quick reply.

    I understand the desire to have the shop manager be able to edit the settings for the plugin… however with the current way this is implemented, the solution to re-enable the “manage_options” permission for Shop Manager impacts the rights of Shop Manager for the entire Woo Commerce application, which has a much too broad impact in my opinion.

    As noted here: https://codex.www.ads-software.com/Roles_and_Capabilities#manage_options the manage_options role allows access to many administrative panels – most of which are inappropriate for what the “shop manager” role was originally intended for – manage the shop without giving them admin access ( https://docs.woocommerce.com/document/roles-capabilities/ ).

    If I may suggest, I don’t think any plugin should modify roles/permissions – I think the functionality you describe should either be removed or re-implemented in a way where the plugin does not change permissions for a user for which the impact is greater than the specific plugin.

    Thanks,
    Justin

    Plugin Support dhara61

    (@dhara61)

    Hi Justin,

    I can understand your point. But currently, we cannot remove or update the capability of the Shop manager user role.

    Reason being, as described earlier, we have added this capability/permission on request of many of our clients.

    If you want we can provide you a customized plugin which will help you achieve your requirements.

    But, after this, make sure you don’t update our plugin and if you update then be assured that you apply the custom changes again on every update.

    Please let me know your decision.

    Regards,
    Dhara Shah

    Thread Starter jwright006

    (@jwright006)

    Hello –

    Thanks for the offer to provide a custom plugin; I have already removed the chunk of code necessary for me to have the desired behavior, so I am good to go for now.

    Unfortunately I likely will be investigating an alternate solution due to the limitation I have described, but I appreciate your quick replies and support.

    Thanks,
    Justin

    Plugin Support dhara61

    (@dhara61)

    Hi Justin,

    Glad to know that you are able to achieve your requirements by making some custom changes in the plugin.

    Also, I can understand your concern but, I will be happy if you will continue to use our plugin for your site.

    We will definitely look for some alternate solution for your requirements.

    Regards,
    Dhara Shah

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Shop Manager – manage_options’ is closed to new replies.