• Resolved kristinubute

    (@kristinubute)


    Hi

    There seems to be an issue with plugin sometimes – Forbidden when trying to save changes

    Basically if I have the client saved as User Administrator then no issues.

    BUT the client doesn’t need full access to all the plugins and all other coding (they only want access and only want to see the Woocommerce Products & Orders area and to update Pages that’s all they want.

    So when I change their User to another Role, other than Administrator, it won’t allow them to UPDATE stock quantity , it says “FORBIDDEN” even though it says Saved, then straight after it says FORBIDDEN.

    I’m at a loss on WHY the plugin doesn’t work with other User Roles which is strange.

    Please if someone could advise urgently would be great.

    Thx
    Kristin

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support mediawebster

    (@mediawebster)

    Thread Starter kristinubute

    (@kristinubute)

    Manage options is already ticked so this is NOT the issue.

    I have duplicated the ADMINISTRATOR role and renamed it and doesn’t allow access to change pricing … still says forbidden.

    Changing User to Shop Manager, still says forbidden.

    NOTHING works unless using ADMINISTRATOR and client does NOT want access to and see it all.

    Please advise urgently
    Thanks
    Kristin

    Thread Starter kristinubute

    (@kristinubute)

    HI so I have looked at your links.

    So one of the codes which was on your link (can I change to my current User Role called
    CLIENT-ROLE) . Can I just add CLIENT-ROLE somewhere below here to ALLOW that User to EDIT please.

    To be able to EDIT the pricing in the Bulk Editor, Other Users apart from Administrator should be able to edit and changing pricing and stock …

    add_filter(‘woobe_user_can_edit’, function($is_forbidden, $field_key, $shop_manager_visibility_array) {
    $user = wp_get_current_user();
    //print_r($shop_manager_visibility_array);
    if (in_array(‘author’, (array) $user->roles)) {
    if ($field_key == ‘sku’) {
    $is_forbidden = 1;
    }
    }

    return $is_forbidden;
    }, 10, 3);

    Please advise urgently …

    Thread Starter kristinubute

    (@kristinubute)

    There must be somewhere in your plugin, where it will ONLY allow Administrator to make changes … How can I fix that please urgently ?

    I have user role called CLIENT-ROLE that I want ACCESS

    Can we do a particular function that will work ?

    Thanks
    Kristin

    Plugin Support mediawebster

    (@mediawebster)

    Hello Kristin

    Please use this code:

    add_filter('woobe_user_can_edit', function($is_forbidden, $field_key, $shop_manager_visibility_array) {
    
     
        return 1;
    }, 10, 3);
    Thread Starter kristinubute

    (@kristinubute)

    Yes that was perfect, it allows the other Store Managers access also !!
    I had another User called WOOCOMMERCE_EDITORS and it allowed them to change it now also.!

    Thanks
    Kristin

    Plugin Support mediawebster

    (@mediawebster)

    Hello Kristin

    Welcome;)

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Issue with plugin sometimes – Forbidden when trying to save changes’ is closed to new replies.