From 88b456a542be124559a26af86e8cff1f9eaea270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien?= Date: Thu, 14 Dec 2017 11:53:48 +0100 Subject: [PATCH] Resolve bug for REST API PUT task An error occured when I was trying to PUT task despite all rigths. Ressource 'task' --> 'tasks' --- htdocs/projet/class/api_tasks.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index d5215ef8106..81e28663cc4 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -275,7 +275,7 @@ class Tasks extends DolibarrApi throw new RestException(404, 'Task not found'); } - if( ! DolibarrApi::_checkAccessToResource('task',$this->task->id)) { + if( ! DolibarrApi::_checkAccessToResource('tasks',$this->task->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -432,7 +432,7 @@ class Tasks extends DolibarrApi throw new RestException(404, 'Task not found'); } - if( ! DolibarrApi::_checkAccessToResource('task',$this->project->id)) { + if( ! DolibarrApi::_checkAccessToResource('tasks',$this->project->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } foreach($request_data as $field => $value) { @@ -467,7 +467,7 @@ class Tasks extends DolibarrApi throw new RestException(404, 'Task not found'); } - if( ! DolibarrApi::_checkAccessToResource('task',$this->project->id)) { + if( ! DolibarrApi::_checkAccessToResource('tasks',$this->project->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); }