Skip to content
Snippets Groups Projects
Commit 4fc4ce88 authored by Jared Hancock's avatar Jared Hancock
Browse files

Fix crash changing ticket status from listing page

parent 0c9fb8c5
No related branches found
No related tags found
No related merge requests found
......@@ -495,12 +495,12 @@ class TicketsAjaxAPI extends AjaxController {
$state = 'open';
break;
case 'close':
if (!$thisstaff->hasPerm(TicketModel::PERM_CLOSE))
if (!$thisstaff->hasPerm(TicketModel::PERM_CLOSE, false))
Http::response(403, 'Access denied');
$state = 'closed';
break;
case 'delete':
if (!$thisstaff->hasPerm(TicketModel::PERM_DELETE))
if (!$thisstaff->hasPerm(TicketModel::PERM_DELETE, false))
Http::response(403, 'Access denied');
$state = 'deleted';
......@@ -534,18 +534,18 @@ class TicketsAjaxAPI extends AjaxController {
// Make sure the agent has permission to set the status
switch(mb_strtolower($status->getState())) {
case 'open':
if (!$thisstaff->hasPerm(TicketModel::PERM_CLOSE)
&& !$thisstaff->hasPerm(TicketModel::PERM_CREATE))
if (!$thisstaff->hasPerm(TicketModel::PERM_CLOSE, false)
&& !$thisstaff->hasPerm(TicketModel::PERM_CREATE, false))
$errors['err'] = sprintf(__('You do not have permission %s.'),
__('to reopen tickets'));
break;
case 'closed':
if (!$thisstaff->hasPerm(TicketModel::PERM_CLOSE))
if (!$thisstaff->hasPerm(TicketModel::PERM_CLOSE, false))
$errors['err'] = sprintf(__('You do not have permission %s.'),
__('to resolve/close tickets'));
break;
case 'deleted':
if (!$thisstaff->hasPerm(TicketModel::PERM_DELETE))
if (!$thisstaff->hasPerm(TicketModel::PERM_DELETE, false))
$errors['err'] = sprintf(__('You do not have permission %s.'),
__('to archive/delete tickets'));
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment