Give the staff with Editor role the ability to see the list of customers

Hello !

My staff members have an Editor Role, Because I only want them to view and manage their own calendar.
Bookly supervisors can view all agendas for all staff members, and i don't want that.

The problem is that the Editors don't have access to the Customer list item in the dashabord.
I really need this so they can create their customers. The Staff Cabinet add-on don't display customers neither.

Anybody managed to do that ? Any ideas ?
I really need this.

1

Comments

2 comments
Date Votes
  • Hello,

    did you find a solution for this issue?

     

    0

  • Hello Ahmed.

    Yes, I had to do some code modification and do it after each update in the core (free) plugin.

    The first edit is to allow editor to see the customer list in the dashboard.

    bakend/bakend.php

    /**
    * @inheritdoc
    */
    protected static function permissions()
    {
    return array( '_default' => 'staff', ); // Require only user to be a staff member to load customers
    }

     

    Then I had to create a custom capability i called "manage_bookly_customer " to allow the customer list to work properly.


    backend/modules/customer/ajax.php 

    if ( $current_user->has_cap( $required_capability ) || $current_user->has_cap( 'manage_bookly_appointments' ) || $current_user->has_cap( 'manage_bookly_customer' ) ) { // Add custom capability "manage_bookly_customer" with User Role Editor
    add_submenu_page( 'bookly-menu', $customers, $customers, 'read',
    Modules\Customers\Page::pageSlug(), function () { Modules\Customers\Page::render(); } );
    }


    It's the only way I found while waiting It to be implemented in future updates.

    But it require to be done for every update and require coding knowledge because the code change between versions.

    Hope it helps.

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post