Change WordPress user roles and capabilities › Forums › Give user access to plugin – how to › Enable Access to Amelia Plugin
- This topic has 5 replies, 2 voices, and was last updated 3 years, 11 months ago by Vladimir.
-
AuthorPosts
-
15/12/2020 at 17:58 #7210galliproParticipant
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
16/12/2020 at 11:13 #7212VladimirKeymasterDid 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.
16/12/2020 at 12:23 #7213galliproParticipantHere is the plugin. [removed]
16/12/2020 at 13:33 #7216VladimirKeymasterYou 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.16/12/2020 at 15:49 #7217galliproParticipantWhere would I add this code? I have a user role called shop_manager for which i want to enable the plugin for.
17/12/2020 at 02:48 #7218VladimirKeymasterYou 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.
-
AuthorPosts
- You must be logged in to reply to this topic.