From a3956d29bb12973ce7a2d7ce3d158b4e4f255031 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Mon, 26 Aug 2013 23:28:11 +0000 Subject: [PATCH] Add permission: inbound_route_advanced --- app/dialplan_inbound/app_config.php | 3 +++ app/dialplan_inbound/dialplan_inbound_add.php | 16 +++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/dialplan_inbound/app_config.php b/app/dialplan_inbound/app_config.php index 09dfec77d5..aed3dd6ada 100644 --- a/app/dialplan_inbound/app_config.php +++ b/app/dialplan_inbound/app_config.php @@ -44,6 +44,9 @@ $apps[$x]['permissions'][1]['groups'][] = 'superadmin'; $apps[$x]['permissions'][1]['groups'][] = 'admin'; + $apps[$x]['permissions'][1]['name'] = 'inbound_route_advanced'; + $apps[$x]['permissions'][1]['groups'][] = 'superadmin'; + $apps[$x]['permissions'][2]['name'] = 'inbound_route_edit'; $apps[$x]['permissions'][2]['groups'][] = 'superadmin'; diff --git a/app/dialplan_inbound/dialplan_inbound_add.php b/app/dialplan_inbound/dialplan_inbound_add.php index 9776afca66..f0eacf90c2 100644 --- a/app/dialplan_inbound/dialplan_inbound_add.php +++ b/app/dialplan_inbound/dialplan_inbound_add.php @@ -96,7 +96,7 @@ require_once "resources/paging.php"; unset ($prep_statement); } - if (if_group("superadmin") && $action == "advanced") { + if (permission_exists("inbound_route_advanced") && $action == "advanced") { //allow users in the superadmin group advanced control } else { @@ -643,11 +643,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; echo " \n"; - if (permission_exists("inbound_route_edit") && $action == "advanced") { - echo " \n"; - } - else { - echo " \n"; + if (permission_exists("inbound_route_advanced")) { + if (permission_exists("inbound_route_edit") && $action == "advanced") { + echo " \n"; + } + else { + echo " \n"; + } } echo " \n"; echo " \n"; @@ -678,7 +680,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; - if (permission_exists("inbound_route_edit") && $action == "advanced" && if_group("superadmin")) { + if (permission_exists("inbound_route_edit") && $action == "advanced" && permission_exists("inbound_route_advanced")) { echo "\n"; echo "\n"; echo " ".$text['label-condition_1'].":\n";