enhance customer role capability

This commit is contained in:
GotPPay
2018-08-07 13:55:59 +02:00
parent 5ceb376f8f
commit 7725556f38
4 changed files with 34 additions and 4 deletions

View File

@@ -7,7 +7,8 @@ class Wiaas_DB_Update {
private static $db_updates = array(
'20180728222206' => 'wiaas_db_update_enable_product_by_user_role',
'20180801222206' => 'wiaas_db_update_setup_gravity',
'20180802222206' => 'wiaas_db_update_add_delivery_process_forms'
'20180802222206' => 'wiaas_db_update_add_delivery_process_forms',
'20180807222206' => 'wiaas_db_update_setup_customer_capabilities'
);
public static function execute() {

View File

@@ -76,4 +76,11 @@ function wiaas_db_update_add_delivery_process_forms() {
}
do_action('gform_forms_post_import', $created_forms);
}
function wiaas_db_update_setup_customer_capabilities() {
$customer_role = get_role('customer');
$customer_role->add_cap('read_private_shop_orders');
$customer_role->add_cap('read_shop_order');
}