diff --git a/app/extensions/app_config.php b/app/extensions/app_config.php index d99d130bdb..c989786d7d 100644 --- a/app/extensions/app_config.php +++ b/app/extensions/app_config.php @@ -83,6 +83,9 @@ //$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; //$apps[$x]['permissions'][$y]['groups'][] = "admin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "extension_user_context"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; //schema details $y = 0; //table array index diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index 0476f24a40..c1abff27c6 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -328,7 +328,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { } //set the default user context - if (if_group("superadmin")) { + if (permission_exists("extension_user_context")) { //allow a user assigned to super admin to change the user_context } else { @@ -634,7 +634,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "directory_exten_visible = '$directory_exten_visible', "; $sql .= "limit_max = '$limit_max', "; $sql .= "limit_destination = '$limit_destination', "; - $sql .= "user_context = '$user_context', "; + if (permission_exists("extension_context")) { + $sql .= "user_context = '$user_context', "; + } if (permission_exists('extension_missed_call')) { $sql .= "missed_call_app = '$missed_call_app', "; $sql .= "missed_call_data = '$missed_call_data', ";