Skip to content

Commit

Permalink
Check if user can update the task
Browse files Browse the repository at this point in the history
Found a bug in Glpi where a user with task create rights, but
without task update rights (that, of course, cannot be assigned to
a task), when create a new task, can get assigned to that task (when
shouldn't). So we must test for task update rights before allow using
the timer's buttons.
  • Loading branch information
Multiconecta committed Mar 21, 2019
1 parent d550512 commit 2b3e616
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static public function postForm($params) {

$task_id = $item->getID();
$rand = mt_rand();
$buttons = self::checkTech($task_id);
$buttons = (self::checkTech($task_id) && $item->can($task_id, UPDATE));
$time = self::totalEndTime($task_id);
$text_restart = __('Restart', 'actualtime');
$text_pause = __('Pause', 'actualtime');
Expand Down

0 comments on commit 2b3e616

Please sign in to comment.