testing progress
This commit is contained in:
@@ -17,6 +17,7 @@ class TWP_Core {
|
||||
|
||||
$this->load_dependencies();
|
||||
$this->set_locale();
|
||||
$this->ensure_user_roles();
|
||||
$this->define_admin_hooks();
|
||||
$this->define_public_hooks();
|
||||
$this->define_api_hooks();
|
||||
@@ -62,6 +63,31 @@ 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')) {
|
||||
// Create the Phone Agent role with limited capabilities
|
||||
add_role('phone_agent', 'Phone Agent', array(
|
||||
// Basic WordPress capabilities
|
||||
'read' => true,
|
||||
|
||||
// Profile management
|
||||
'edit_profile' => true,
|
||||
|
||||
// Phone agent specific capabilities
|
||||
'twp_access_voicemails' => true,
|
||||
'twp_access_call_log' => true,
|
||||
'twp_access_agent_queue' => true,
|
||||
'twp_access_outbound_calls' => true,
|
||||
'twp_access_sms_inbox' => true,
|
||||
'twp_access_browser_phone' => true,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register admin hooks
|
||||
*/
|
||||
|
Reference in New Issue
Block a user