testing progress

This commit is contained in:
2025-08-12 09:54:32 -07:00
parent e18e046431
commit 2d6767033b
3 changed files with 654 additions and 256 deletions

View File

@@ -14,6 +14,9 @@ class TWP_Activator {
// Set default options
self::set_default_options();
// Create custom user roles
self::create_user_roles();
// Set the database version
if (defined('TWP_DB_VERSION')) {
update_option('twp_db_version', TWP_DB_VERSION);
@@ -373,4 +376,29 @@ class TWP_Activator {
add_option('twp_sms_notification_number', '');
add_option('twp_default_sms_number', '');
}
/**
* Create custom user roles for the plugin
*/
private static function create_user_roles() {
// Remove role first if it exists to ensure clean setup
remove_role('phone_agent');
// Add 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,
));
}
}