From a8a578962c17eeeaec54d657ac8078f341deb971 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 28 Apr 2014 16:19:39 +0000 Subject: [PATCH] Changes to ACL dialog based on list filter: - If '... run rights to other applications', show current apps with run rights for the account - For others, restrict application selectbox options to just applications that support ACL --- admin/inc/class.admin_acl.inc.php | 1 + admin/js/app.js | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/admin/inc/class.admin_acl.inc.php b/admin/inc/class.admin_acl.inc.php index a8ae26079c..3edd9599fb 100644 --- a/admin/inc/class.admin_acl.inc.php +++ b/admin/inc/class.admin_acl.inc.php @@ -469,6 +469,7 @@ class admin_acl ), array(), true), ); $user = common::grab_owner_name($content['nm']['account_id']); + $content['acl_apps'] = $GLOBALS['egw']->acl->get_app_list_for_id('run', acl::READ, $account_id); $sel_options = array( 'filter' => array( 'other' => lang('Access to %1 data by others', $user), diff --git a/admin/js/app.js b/admin/js/app.js index 84bc34cd99..f392cf04b6 100644 --- a/admin/js/app.js +++ b/admin/js/app.js @@ -391,7 +391,21 @@ app.classes.admin = AppJS.extend( } if(!content.acl_location) { - content.acl_location = this.et2.getWidgetById('filter2').getValue() == 'run' ? 'run' : null; + content.acl_location = this.et2.getWidgetById('filter').getValue() == 'run' ? 'run' : null; + } + if(content.acl_location == 'run') + { + // These are the apps the account has access to + content.apps = this.et2.getArrayMgr('content').getEntry('acl_apps')||''; + } + else + { + // Restrict application selectbox to only apps that support ACL + sel_options.acl_appname = {}; + for(var app in acl_rights) + { + sel_options.acl_appname[app] = this.egw.lang(app); + } } if(!content.acl_account) {