Changing capabilities for Bookly?
-
Hey,
I’ve got bookly installed and when I set one of my users as an Editor bookly disappears on the side bar – Is there a way to allow them access to certain options in bookly?
I’ve found the AB_Backend.php page – which is currently:
if ( $current_user->has_cap( 'administrator' ) || AB_Staff::query()->where( 'wp_user_id', $current_user->ID )->count() ) { if ( function_exists( 'add_options_page' ) ) { $dynamic_position = '80.0000001' . mt_rand( 1, 1000 ); // position always is under <code>Settings</code> add_menu_page( 'Bookly', 'Bookly', 'read', 'ab-system', '', plugins_url( 'resources/images/menu.png', __FILE__ ), $dynamic_position ); add_submenu_page( 'ab-system', $calendar, $calendar, 'read', 'ab-calendar', array( $this->calendarController, 'index' ) ); add_submenu_page( 'ab-system', $appointments, $appointments, 'manage_options', 'ab-appointments', array( $this->appointmentsController, 'index' ) ); if ( $current_user->has_cap( 'administrator' ) ) { add_submenu_page( 'ab-system', $staff_members, $staff_members, 'manage_options', AB_StaffController::page_slug, array( $this->staffController, 'index' ) ); } else { if ( get_option( 'ab_settings_allow_staff_members_edit_profile' ) == 1 ) { add_submenu_page( 'ab-system', __( 'Profile', 'bookly' ), __( 'Profile', 'bookly' ), 'read', AB_StaffController::page_slug, array( $this->staffController, 'index' ) ); } } add_submenu_page( 'ab-system', $services, $services, 'manage_options', AB_ServiceController::page_slug, array( $this->serviceController, 'index' ) ); add_submenu_page( 'ab-system', $customers, $customers, 'manage_options', AB_CustomerController::page_slug, array( $this->customerController, 'index' ) ); add_submenu_page( 'ab-system', $notifications, $notifications, 'manage_options', 'ab-notifications', array( $this->notificationsController, 'index' ) ); add_submenu_page( 'ab-system', $sms, $sms, 'manage_options', AB_SmsController::page_slug, array( $this->smsController, 'index' ) ); add_submenu_page( 'ab-system', $payments, $payments, 'manage_options', 'ab-payments', array( $this->paymentController, 'index' ) ); add_submenu_page( 'ab-system', $appearance, $appearance, 'manage_options', 'ab-appearance', array( $this->apearanceController, 'index' ) ); add_submenu_page( 'ab-system', $custom_fields, $custom_fields, 'manage_options', 'ab-custom-fields', array( $this->customFieldsController, 'index' ) ); add_submenu_page( 'ab-system', $coupons, $coupons, 'manage_options', 'ab-coupons', array( $this->couponsController, 'index' ) ); add_submenu_page( 'ab-system', $settings, $settings, 'manage_options', AB_SettingsController::page_slug, array( $this->settingsController, 'index' ) ); global $submenu; do_action( 'bookly_admin_menu', 'ab-system' ); unset( $submenu['ab-system'][0] ); } }
It looks like some of the pages are set as “read” and some as “manage_options” – Can I make up my own capability names and then restrict the section within User Role Editor or do I need to leave these alone and just allow my editor to “read” and “manage_options” (Which I really don’t want to do…)?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Changing capabilities for Bookly?’ is closed to new replies.