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');
}

View File

@@ -47,6 +47,7 @@
"wpackagist-plugin/mailchimp-for-woocommerce": "2.1.7",
"wpackagist-plugin/woocommerce-gateway-paypal-express-checkout": "1.5.6",
"wpackagist-plugin/jwt-authentication-for-wp-rest-api": "1.2.4",
"wpackagist-plugin/capability-manager-enhanced": "1.5.9",
"3rdparty/gravityforms": "*",
"3rdparty/gravityflow": "*"
@@ -75,7 +76,8 @@
"wp plugin activate jwt-authentication-for-wp-rest-api",
"wp plugin activate gravityforms",
"wp plugin activate gravityflow",
"wp plugin activate wiaas"
"wp plugin activate wiaas",
"wp plugin activate capability-manager-enhanced"
],
"update-db": [
"wp core update-db",

24
backend/composer.lock generated
View File

@@ -1,10 +1,10 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "16aac868dbf84d6c3cf7c41703e9085f",
"content-hash": "dca54e67b0185da192f5260baa4c162e",
"packages": [
{
"name": "3rdparty/gravityflow",
@@ -437,6 +437,26 @@
"type": "wordpress-plugin",
"homepage": "https://wordpress.org/plugins/akismet/"
},
{
"name": "wpackagist-plugin/capability-manager-enhanced",
"version": "1.5.9",
"source": {
"type": "svn",
"url": "https://plugins.svn.wordpress.org/capability-manager-enhanced/",
"reference": "trunk"
},
"dist": {
"type": "zip",
"url": "https://downloads.wordpress.org/plugin/capability-manager-enhanced.zip?timestamp=1532180189",
"reference": null,
"shasum": null
},
"require": {
"composer/installers": "~1.0"
},
"type": "wordpress-plugin",
"homepage": "https://wordpress.org/plugins/capability-manager-enhanced/"
},
{
"name": "wpackagist-plugin/groups",
"version": "2.3.1",