PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.4
Booking for Appointments and Events Calendar – Amelia v2.4.4
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / src / Infrastructure / WP / config / Roles.php
ameliabooking / src / Infrastructure / WP / config Last commit date
Menu.php 5 months ago Roles.php 6 months ago
Roles.php
210 lines
1 <?php
2
3 /**
4 * @author Alexander Gilmanov
5 * Defining the user roles and capabilities
6 */
7
8 namespace AmeliaBooking\Infrastructure\WP\config;
9
10 /**
11 * Class Roles
12 *
13 * @package AmeliaBooking\Infrastructure\WP\config
14 */
15 class Roles
16 {
17 /**
18 * Array of all Amelia roles capabilities
19 */
20 public static array $rolesList = [
21 'amelia_read_menu',
22 'amelia_read_dashboard',
23 'amelia_read_whats_new',
24 'amelia_read_lite_vs_premium',
25 'amelia_read_calendar',
26 'amelia_read_appointments',
27 'amelia_read_events',
28 'amelia_read_employees',
29 'amelia_read_services',
30 'amelia_read_packages',
31 'amelia_read_resources',
32 'amelia_read_locations',
33 'amelia_read_taxes',
34 'amelia_read_coupons',
35 'amelia_read_customers',
36 'amelia_read_finance',
37 'amelia_read_notifications',
38 'amelia_read_customize',
39 'amelia_read_custom_fields',
40 'amelia_read_settings',
41
42 'amelia_read_others_settings',
43 'amelia_read_others_dashboard',
44 'amelia_read_others_calendar',
45 'amelia_read_others_appointments',
46 'amelia_read_others_services',
47 'amelia_read_others_employees',
48 'amelia_read_others_customers',
49
50 'amelia_write_dashboard',
51 'amelia_write_calendar',
52 'amelia_write_appointments',
53 'amelia_write_events',
54 'amelia_write_employees',
55 'amelia_write_services',
56 'amelia_write_packages',
57 'amelia_write_resources',
58 'amelia_write_locations',
59 'amelia_write_taxes',
60 'amelia_write_coupons',
61 'amelia_write_customers',
62 'amelia_write_finance',
63 'amelia_write_notifications',
64 'amelia_write_customize',
65 'amelia_write_custom_fields',
66 'amelia_write_settings',
67 'amelia_write_status',
68
69 'amelia_write_others_settings',
70 'amelia_write_others_calendar',
71 'amelia_write_others_appointments',
72 'amelia_write_others_services',
73 'amelia_write_others_employees',
74 'amelia_write_others_events',
75 'amelia_write_others_finance',
76 'amelia_write_others_dashboard',
77
78 'amelia_delete_dashboard',
79 'amelia_delete_calendar',
80 'amelia_delete_appointments',
81 'amelia_delete_events',
82 'amelia_delete_employees',
83 'amelia_delete_services',
84 'amelia_delete_packages',
85 'amelia_delete_resources',
86 'amelia_delete_locations',
87 'amelia_delete_taxes',
88 'amelia_delete_coupons',
89 'amelia_delete_customers',
90 'amelia_delete_finance',
91 'amelia_delete_notifications',
92 'amelia_delete_customize',
93 'amelia_delete_custom_fields',
94 'amelia_delete_settings',
95
96 'amelia_write_status_appointments',
97 'amelia_write_status_events',
98 'amelia_write_time_appointments',
99 ];
100
101 /**
102 * Array of all amelia roles with capabilities
103 *
104 * @return array
105 */
106 public function __invoke()
107 {
108 return [
109 // Customer
110 [
111 'name' => 'wpamelia-customer',
112 'label' => __('Amelia Customer', 'amelia'),
113 'capabilities' => [
114 'read' => true,
115 'amelia_read_menu' => true,
116 'amelia_read_calendar' => true,
117 'amelia_read_appointments' => true,
118 'amelia_read_events' => true,
119 'amelia_write_time_appointments' => true,
120 ]
121 ],
122
123 // Provider
124 [
125 'name' => 'wpamelia-provider',
126 'label' => __('Amelia Employee', 'amelia'),
127 'capabilities' => [
128 'read' => true,
129 'amelia_delete_events' => true,
130 'amelia_read_menu' => true,
131 'amelia_read_calendar' => true,
132 'amelia_read_appointments' => true,
133 'amelia_read_events' => true,
134 'amelia_read_employees' => true,
135 'amelia_read_others_customers' => true,
136 'amelia_read_others_services' => false,
137 'amelia_write_employees' => true,
138 'amelia_write_status_appointments' => true,
139 'amelia_write_status_events' => true,
140 'amelia_write_time_appointments' => true,
141 'amelia_write_others_appointments' => false,
142 'amelia_write_others_services' => false,
143 'amelia_write_appointments' => true,
144 'amelia_write_events' => true,
145 'amelia_write_others_events' => false,
146 ]
147 ],
148
149 // Manager
150 [
151 'name' => 'wpamelia-manager',
152 'label' => __('Amelia Manager', 'amelia'),
153 'capabilities' => [
154 'read' => true,
155
156 'amelia_delete_events' => true,
157 'amelia_read_menu' => true,
158 'amelia_read_dashboard' => true,
159 'amelia_read_whats_new' => true,
160 'amelia_read_lite_vs_premium' => true,
161 'amelia_read_calendar' => true,
162 'amelia_read_appointments' => true,
163 'amelia_read_events' => true,
164 'amelia_read_employees' => true,
165 'amelia_read_services' => true,
166 'amelia_read_resources' => true,
167 'amelia_read_packages' => true,
168 'amelia_read_locations' => true,
169 'amelia_read_taxes' => true,
170 'amelia_read_coupons' => true,
171 'amelia_read_customers' => true,
172 'amelia_read_finance' => true,
173 'amelia_read_notifications' => true,
174 'amelia_read_others_dashboard' => true,
175 'amelia_read_others_calendar' => true,
176 'amelia_read_others_appointments' => true,
177 'amelia_read_others_services' => true,
178 'amelia_read_others_employees' => true,
179 'amelia_read_others_customers' => true,
180 'amelia_write_dashboard' => true,
181 'amelia_write_calendar' => true,
182 'amelia_write_appointments' => true,
183 'amelia_write_events' => true,
184 'amelia_write_employees' => true,
185 'amelia_write_services' => true,
186 'amelia_write_resources' => true,
187 'amelia_write_packages' => true,
188 'amelia_write_locations' => true,
189 'amelia_write_taxes' => true,
190 'amelia_write_coupons' => true,
191 'amelia_write_customers' => true,
192 'amelia_write_finance' => true,
193 'amelia_write_notifications' => true,
194 'amelia_write_others_calendar' => true,
195 'amelia_write_others_appointments' => true,
196 'amelia_write_others_services' => true,
197 'amelia_write_others_employees' => true,
198 'amelia_write_others_events' => true,
199 'amelia_write_others_finance' => true,
200 'amelia_write_others_dashboard' => true,
201 'amelia_write_status_appointments' => true,
202 'amelia_write_status_events' => true,
203 'amelia_write_time_appointments' => true,
204 'upload_files' => true,
205 ]
206 ],
207 ];
208 }
209 }
210