Skip to content

Commit 98a76f2

Browse files
committed
fix(dropdownfield): restrict itemtypes assignables to ticket
Signed-off-by: Thierry Bugier <[email protected]>
1 parent 8b94022 commit 98a76f2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

inc/fields/dropdownfield.class.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,12 @@ public function displayField($canEdit = true) {
123123
break;
124124

125125
default:
126-
if (in_array($itemtype, $CFG_GLPI['ticket_types'])) {
126+
$assignableToTicket = in_array($itemtype, $CFG_GLPI['ticket_types']);
127+
if (Session::getLoginUserID()) {
128+
// Restrict assignable types to current profile's settings
129+
$assignableToTicket = CommonITILObject::isPossibleToAssignType($itemtype);
130+
}
131+
if ($assignableToTicket) {
127132
$userFk = User::getForeignKeyField();
128133
$groupFk = Group::getForeignKeyField();
129134
$canViewAllHardware = Session::haveRight('helpdesk_hardware', pow(2, Ticket::HELPDESK_ALL_HARDWARE));

0 commit comments

Comments
 (0)