Skip to content

Commit

Permalink
fix(issue): restrict user dropdowns to current user in service catalog
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jun 13, 2021
1 parent 9f17713 commit 3ad80e2
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions inc/issue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public function rawSearchOptions() {
}
$tab[] = $newtab;

$tab[] = [
$newtab = [
'id' => '9',
'table' => 'glpi_users',
'field' => 'name',
Expand All @@ -506,6 +506,11 @@ public function rawSearchOptions() {
'datatype' => 'dropdown',
'massiveaction' => false
];
if (!Session::isCron() // no filter for cron
&& Session::getCurrentInterface() == 'helpdesk') {
$newtab['right'] = 'id';
}
$tab[] = $newtab;

$tab[] = [
'id' => '10',
Expand All @@ -516,7 +521,7 @@ public function rawSearchOptions() {
'massiveaction' => false
];

$tab[] = [
$newtab = [
'id' => '11',
'table' => 'glpi_users',
'field' => 'name',
Expand Down Expand Up @@ -545,8 +550,13 @@ public function rawSearchOptions() {
]
]
];
if (!Session::isCron() // no filter for cron
&& Session::getCurrentInterface() == 'helpdesk') {
$newtab['right'] = 'id';
}
$tab[] = $newtab;

$tab[] = [
$newtab = [
'id' => '14',
'table' => User::getTable(),
'field' => 'name',
Expand All @@ -567,6 +577,11 @@ public function rawSearchOptions() {
]
]
];
if (!Session::isCron() // no filter for cron
&& Session::getCurrentInterface() == 'helpdesk') {
$newtab['right'] = 'id';
}
$tab[] = $newtab;

$tab[] = [
'id' => '15',
Expand Down

0 comments on commit 3ad80e2

Please sign in to comment.