From 2ab51680bee2da0df974e6592d9a52cfea4e6d56 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 18 Sep 2014 15:01:08 +0000 Subject: [PATCH] Fix access UI to take user's permissions into account, and not let them try to edit run rights --- admin/inc/class.admin_acl.inc.php | 2 ++ admin/js/app.js | 5 +++++ admin/templates/default/acl.xet | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/admin/inc/class.admin_acl.inc.php b/admin/inc/class.admin_acl.inc.php index f95ffebf68..5eb27d0253 100644 --- a/admin/inc/class.admin_acl.inc.php +++ b/admin/inc/class.admin_acl.inc.php @@ -409,10 +409,12 @@ class admin_acl 'caption' => 'Edit', 'default' => true, 'allowOnMultiple' => false, + 'disableClass' => 'rowNoEdit', 'onExecute' => 'javaScript:app.admin.acl', ), 'add' => array( 'caption' => 'Add', + 'disableClass' => 'rowNoEdit', 'onExecute' => 'javaScript:app.admin.acl', ), 'delete' => array( diff --git a/admin/js/app.js b/admin/js/app.js index a06aedd5ed..9c0ac0ed36 100644 --- a/admin/js/app.js +++ b/admin/js/app.js @@ -468,6 +468,11 @@ app.classes.admin = AppJS.extend( { content.acl_location = this.et2.getWidgetById('filter').getValue() == 'run' ? 'run' : null; } + // If no admin rights, change UI to not allow adding access to apps + if(content.acl_location == 'run' && !egw.user('apps')['admin']) + { + content.acl_location = null; + } if(content.acl_location == 'run') { // These are the apps the account has access to diff --git a/admin/templates/default/acl.xet b/admin/templates/default/acl.xet index be8679fc11..9ad21516e9 100644 --- a/admin/templates/default/acl.xet +++ b/admin/templates/default/acl.xet @@ -35,7 +35,7 @@ - +