Merge pull request #18840 from homer8173/patch-23

it was impossible to update a task
This commit is contained in:
Laurent Destailleur 2021-09-30 13:34:46 +02:00 committed by GitHub
commit 89b24f1690
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -454,7 +454,7 @@ class Tasks extends DolibarrApi
throw new RestException(404, 'Task not found');
}
if (!DolibarrApi::_checkAccessToResource('tasks', $this->project->id)) {
if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
foreach ($request_data as $field => $value) {
@ -488,7 +488,7 @@ class Tasks extends DolibarrApi
throw new RestException(404, 'Task not found');
}
if (!DolibarrApi::_checkAccessToResource('tasks', $this->project->id)) {
if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}