Home › Forums › WC Vendors Pro Support › Adjust permissions/Role › Reply To: Adjust permissions/Role
May 18, 2017 at 5:06 pm
#65591
Member
@bigbensnake
This may be what you need..
wp-content/plugins/wc-vendors-pro/public/class-wcvendors-pro-dashboard.php
lines 463-496:
/**
* Can the current user view the dashboard ?
*
* @since 1.0.0
*/
public function can_view_dashboard() {
if ( !is_user_logged_in() ) {
return false;
} else if ( !WCV_Vendors::is_vendor( get_current_user_id() ) ) {
// Include the dashboard wrapper
include_once( apply_filters( 'wcvendors_pro_dashboard_open_path', 'partials/wcvendors-pro-dashboard-open.php' ) );
if ( WCVendors_Pro_Vendor_Controller::is_pending_vendor( get_current_user_id() ) ) {
$vendor_pending_notice = WCVendors_Pro::get_option( 'vendor_pending_notice' );
wc_get_template( 'vendor-pending-notice.php', array( 'vendor_pending_notice' => $vendor_pending_notice ), 'wc-vendors/front/', $this->base_dir . '/templates/front/' );
return false;
} elseif ( !current_user_can('administrator') ) {
$vendor_signup_notice = WCVendors_Pro::get_option( 'vendor_signup_notice' );
// Load the new sign up form template
wc_get_template( 'vendor-signup-form.php', array( 'vendor_signup_notice' => $vendor_signup_notice ), 'wc-vendors/front/', $this->base_dir . '/templates/front/' );
return false;
} else {
echo __( 'Admins cannot apply to be vendors. ', 'wcvendors-pro' );
return false;
}
// Close the dashboard wrapper
include_once( apply_filters( 'wcvendors_pro_dashboard_close_path', 'partials/wcvendors-pro-dashboard-close.php' ) );
}
return true;
} // can_view_dashboard()