Skip to content

Commit

Permalink
refactor(permission): Added capability label
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbir1991 committed Apr 26, 2018
1 parent bdbcf39 commit abd33ac
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion classes/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function user_roles() {
$all_cap = dokan_get_all_caps();

foreach( $all_cap as $key=>$cap ) {
$capabilities = array_merge( $capabilities, $cap );
$capabilities = array_merge( $capabilities, array_keys( $cap ) );
}

$wp_roles->add_cap( 'shop_manager', 'dokandar' );
Expand Down
80 changes: 40 additions & 40 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2494,62 +2494,62 @@ function dokan_get_vendor( $vendor_id = null ) {
function dokan_get_all_caps() {
$capabilities = array(
'overview' => array(
'dokan_view_sales_overview',
'dokan_view_sales_report_chart',
'dokan_view_announcement',
'dokan_view_order_report',
'dokan_view_review_reports',
'dokan_view_product_status_report',
'dokan_view_sales_overview' => __( 'View sales overview', 'dokan-lite' ),
'dokan_view_sales_report_chart' => __( 'View sales report chart', 'dokan-lite' ),
'dokan_view_announcement' => __( 'View announcement', 'dokan-lite' ),
'dokan_view_order_report' => __( 'View order report', 'dokan-lite' ),
'dokan_view_review_reports' => __( 'View review report', 'dokan-lite' ),
'dokan_view_product_status_report' => __( 'View product status report', 'dokan-lite' ),
),
'report' => array(
'dokan_view_overview_report',
'dokan_view_daily_sale_report',
'dokan_view_top_selling_report',
'dokan_view_top_earning_report',
'dokan_view_statement_report',
'dokan_view_overview_report' => __( 'View overview report', 'dokan-lite' ),
'dokan_view_daily_sale_report' => __( 'View daily sales report', 'dokan-lite' ),
'dokan_view_top_selling_report' => __( 'View top selling report', 'dokan-lite' ),
'dokan_view_top_earning_report' => __( 'View top earning report', 'dokan-lite' ),
'dokan_view_statement_report' => __( 'View statement report', 'dokan-lite' ),
),
'order' => array(
'dokan_view_order',
'dokan_manage_order',
'dokan_manage_order_note',
'dokan_manage_refund',
'dokan_view_order' => __( 'View order', 'dokan-lite' ),
'dokan_manage_order' => __( 'Manage order', 'dokan-lite' ),
'dokan_manage_order_note' => __( 'Manage order note', 'dokan-lite' ),
'dokan_manage_refund' => __( 'Manage refund', 'dokan-lite' ),
),

'coupon' => array(
'dokan_add_coupon',
'dokan_edit_coupon',
'dokan_delete_coupon',
'dokan_add_coupon' => __( 'Add coupon', 'dokan-lite' ),
'dokan_edit_coupon' => __( 'Edit coupon', 'dokan-lite' ),
'dokan_delete_coupon' => __( 'Delete coupon', 'dokan-lite' ),
),
'review' => array(
'dokan_view_reviews',
'dokan_manage_reviews',
'dokan_view_reviews' => __( 'View reviews', 'dokan-lite' ),
'dokan_manage_reviews' => __( 'Manage reviews', 'dokan-lite' ),
),

'withdraw' => array(
'dokan_manage_withdraw',
'dokan_manage_withdraw' => __( 'Manage withdraw', 'dokan-lite' ),
),
'product' => array(
'dokan_add_product',
'dokan_edit_product',
'dokan_delete_product',
'dokan_view_product',
'dokan_duplicate_product',
'dokan_import_product',
'dokan_export_product',
'dokan_add_product' => __( 'Add product', 'dokan-lite' ),
'dokan_edit_product' => __( 'Edit product', 'dokan-lite' ),
'dokan_delete_product' => __( 'Delete product', 'dokan-lite' ),
'dokan_view_product' => __( 'View product', 'dokan-lite' ),
'dokan_duplicate_product' => __( 'Duplicate product', 'dokan-lite' ),
'dokan_import_product' => __( 'Import product', 'dokan-lite' ),
'dokan_export_product' => __( 'Export product', 'dokan-lite' ),
),
'menu' => array(
'dokan_view_overview_menu',
'dokan_view_product_menu',
'dokan_view_order_menu',
'dokan_view_coupon_menu',
'dokan_view_report_menu',
'dokan_view_review_menu',
'dokan_view_withdraw_menu',
'dokan_view_store_settings_menu',
'dokan_view_store_payment_menu',
'dokan_view_store_shipping_menu',
'dokan_view_store_social_menu',
'dokan_view_store_seo_menu',
'dokan_view_overview_menu' => __( 'View overview menu', 'dokan-lite' ),
'dokan_view_product_menu' => __( 'View product menu', 'dokan-lite' ),
'dokan_view_order_menu' => __( 'View order menu', 'dokan-lite' ),
'dokan_view_coupon_menu' => __( 'View coupon menu', 'dokan-lite' ),
'dokan_view_report_menu' => __( 'View report menu', 'dokan-lite' ),
'dokan_view_review_menu' => __( 'Vuew review menu', 'dokan-lite' ),
'dokan_view_withdraw_menu' => __( 'View withdraw menu', 'dokan-lite' ),
'dokan_view_store_settings_menu' => __( 'View store settings menu', 'dokan-lite' ),
'dokan_view_store_payment_menu' => __( 'View payment settings menu', 'dokan-lite' ),
'dokan_view_store_shipping_menu' => __( 'View shipping settings menu', 'dokan-lite' ),
'dokan_view_store_social_menu' => __( 'View social settings menu', 'dokan-lite' ),
'dokan_view_store_seo_menu' => __( 'View seo settings menu', 'dokan-lite' ),
)
);

Expand Down
2 changes: 1 addition & 1 deletion includes/upgrades/dokan-upgrade-2.7.3.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function dokan_update_user_capabilities_273() {
$all_cap = dokan_get_all_caps();

foreach( $all_cap as $key=>$cap ) {
$capabilities = array_merge( $capabilities, $cap );
$capabilities = array_merge( $capabilities, array_keys( $cap ) );
}

foreach ( $capabilities as $key => $capability ) {
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin');
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin');
const BrowserSyncPlugin = require( 'browser-sync-webpack-plugin' );

const config = require( './config.json' );
// const config = require( './config.json' );

// Naming and path settings
var appName = 'app';
Expand Down

0 comments on commit abd33ac

Please sign in to comment.