Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #7210
    gallipro
    Participant

    I wanted to enable access to the amelia plugin for managers. There is a role setup when the plugin is installed but I wanted to do this on another role that is already existing. What are the custom capabilities that I need to add to allow this?

    Here is what I have enabled but it still says permission denied when I try to access the plugin URL

    • amelia_read_appointments
    • amelia_read_calendar
    • amelia_read_coupons
    • amelia_read_customers
    • amelia_read_dashboard
    • amelia_read_employees
    • amelia_read_events
    • amelia_read_finance
    • amelia_read_locations
    • amelia_read_menu
    • amelia_read_notifications
    • amelia_read_others_appointments
    • amelia_read_others_calendar
    • amelia_read_others_customers
    • amelia_read_others_employees
    • amelia_read_services
    • amelia_write_appointments
    • amelia_write_calendar
    • amelia_write_coupons
    • amelia_write_customers
    • amelia_write_dashboard
    • amelia_write_employees
    • amelia_write_events
    • amelia_write_finance
    • amelia_write_locations
    • amelia_write_notifications
    • amelia_write_others_appointments
    • amelia_write_others_dashboard
    • amelia_write_others_employees
    • amelia_write_others_events
    • amelia_write_others_finance
    • amelia_write_services
    • amelia_write_status
    • amelia_write_status_appointments
    • amelia_write_status_events
    • amelia_write_time_appointments
    #7212
    Vladimir
    Keymaster

    Did you try to use existing role from Amelia plugin as a starting point? You can add new role as a copy of selected role, then modify it.

    To say more I need access to Amelia plugin. You can share its zip with support[at-sign]role-editor.com via DropBox or similar service.

    #7213
    gallipro
    Participant

    Here is the plugin. [removed]

    #7216
    Vladimir
    Keymaster

    You have to take into account that Amelia plugin create its admin menu “Amelia” with submenu items only for user who has at least one of Amelia’s user roles or who is a superadmin:

    
            $ameliaRole = UserRoles::getUserAmeliaRole(wp_get_current_user());
    
            // Init menu if user is logged in with amelia role
            if (in_array($ameliaRole, ['admin', 'manager', 'provider', 'customer'])) {
                if ($ameliaRole === 'admin') {
                    ErrorService::setNotices();
                }
    
                $menuItems = new Menu($settingsService);
    
    

    where:
    – ‘admin’=’administrator’ WordPress role;
    – ‘manager’=’wpamelia-manager’;
    – ‘provider’=’wpamelia-provider’;
    – ‘customer’=’wpamelia-customer’.
    So you can use your own custom user role but grant it to a user together with one of Amelia own user roles from the list above.

    #7217
    gallipro
    Participant

    Where would I add this code? I have a user role called shop_manager for which i want to enable the plugin for.

    #7218
    Vladimir
    Keymaster

    You should not input this code anywhere. I took it from Amelia plugin source code, just to show why “Amelia” menu is not available for the user with custom role.

    Solution, grant to a user with shop_manager role the 2nd role – wpamelia-manager. Such user will get access to ‘Amelia’ menu after that.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.