testing progress
This commit is contained in:
@@ -67,8 +67,9 @@ class TWP_Core {
|
||||
* Ensure custom user roles exist
|
||||
*/
|
||||
private function ensure_user_roles() {
|
||||
// Check if the phone_agent role exists
|
||||
if (!get_role('phone_agent')) {
|
||||
$role = get_role('phone_agent');
|
||||
|
||||
if (!$role) {
|
||||
// Create the Phone Agent role with limited capabilities
|
||||
add_role('phone_agent', 'Phone Agent', array(
|
||||
// Basic WordPress capabilities
|
||||
@@ -84,7 +85,13 @@ class TWP_Core {
|
||||
'twp_access_outbound_calls' => true,
|
||||
'twp_access_sms_inbox' => true,
|
||||
'twp_access_browser_phone' => true,
|
||||
'twp_access_phone_numbers' => true,
|
||||
));
|
||||
} else {
|
||||
// Update existing role with any missing capabilities
|
||||
if (!$role->has_cap('twp_access_phone_numbers')) {
|
||||
$role->add_cap('twp_access_phone_numbers');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user