diff --git a/calendar/inc/class.calendar_owner_etemplate_widget.inc.php b/calendar/inc/class.calendar_owner_etemplate_widget.inc.php index 01548d0ef6..5eafb4c32d 100644 --- a/calendar/inc/class.calendar_owner_etemplate_widget.inc.php +++ b/calendar/inc/class.calendar_owner_etemplate_widget.inc.php @@ -169,6 +169,7 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist 'filter' => array('account_id' => null)) + array_diff_key($_REQUEST, array_flip(array('menuaction','query'))); $results = array(); + $is_admin = !!($GLOBALS['egw_info']['user']['apps']['admin']); // Contacts matching accounts the user does not have permission for cause // confusion as user selects the contact and there's nothing there, so @@ -182,8 +183,8 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist $mapped = array(); $_results = array(); - // Handle Api\Accounts seperately - if($type == '') + // Handle Api\Accounts separately, if user is allowed to see accounts + if($type == '' && ($is_admin || !$is_admin && $GLOBALS['egw_info']['user']['preferences']['common']['account_selection'] !== 'none')) { $owngroup_options = $options+array('account_type'=>'owngroups'); $own_groups = Api\Accounts::link_query('',$owngroup_options);