• Resolved midwestE

    (@edouble74)


    The submenu pages for trackship need custom permissions to allow us developers to limit who can change settings and see order statuses. Trackship should use permission “read_shop_order” (or another) for Dashboard and Shipments

    if ( trackship_for_woocommerce()->is_trackship_connected() ) {
    			add_submenu_page( 'trackship-dashboard', 'Dashboard', __( 'Dashboard', 'trackship-for-woocommerce' ), 'manage_woocommerce', 'trackship-dashboard', array( $this, 'dashboard_page_callback' ), 1 );
    			
    			add_submenu_page( 'trackship-dashboard', 'Shipments', __( 'Shipments', 'trackship-for-woocommerce' ), 'manage_woocommerce', 'trackship-shipments', array( $this, 'shipments_page_callback' ), 1 );
    			
    			add_submenu_page( 'trackship-dashboard', 'Settings', __( 'Settings', 'trackship-for-woocommerce' ), 'manage_woocommerce', 'trackship-for-woocommerce', array( $this, 'settings_page_callback' ) );
    		}
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter midwestE

    (@edouble74)

    Sorry, I shouldn’t say custom permissions, but they should be mapped to the corresponding woocommerce permission:

    -Dashboard should use read_shop_order
    -Shipments should use read_shop_order
    -Settings should continue to use manage_woocommerce

    Thread Starter midwestE

    (@edouble74)

    For reference, here are the defined shop permissions that are relevant:

    
    delete_others_shop_orders
    delete_private_shop_orders
    delete_published_shop_orders
    delete_shop_order
    delete_shop_orders
    edit_others_shop_orders
    edit_private_shop_orders
    edit_published_shop_orders
    edit_shop_order
    edit_shop_orders
    publish_shop_orders
    read_private_shop_orders
    read_shop_order
    
    Plugin Author TrackShip

    (@trackship)

    Hi @edouble74
    We will add a filter to change the capabilities of menus in the next version. So you can change the capabilities of the TrackShip menu using the filters.

    Thanks!

    Thread Starter midwestE

    (@edouble74)

    Thank you for being open and responsive, I appreciate it! Adding a good review ??

    Oops I forgot I already reviewed, 5 stars ??

    • This reply was modified 2 years, 9 months ago by midwestE. Reason: Oops!
    Plugin Author TrackShip

    (@trackship)

    Hi @edouble74, We have released a new version with the filter as per your requirement.
    you can add the filters as per your needs. we have added the below filter for capabilities.

    apply_filters( ‘trackship_menu_capabilities’, ‘manage_woocommerce’ )
    apply_filters( ‘trackship_dashboard_menu_capabilities’, ‘manage_woocommerce’ )
    apply_filters( ‘trackship_shipments_menu_capabilities’, ‘manage_woocommerce’ )
    apply_filters( ‘trackship_settings_menu_capabilities’, ‘manage_woocommerce’ )

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Permissions for Dashboard, Shipments, and Settings’ is closed to new replies.