Skip to content

Commit

Permalink
Resolve bug for REST API PUT task
Browse files Browse the repository at this point in the history
An error occured when I was trying to PUT task despite all rigths.

Ressource 'task' --> 'tasks'
  • Loading branch information
AurelienC committed Dec 14, 2017
1 parent c119d7d commit 88b456a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions htdocs/projet/class/api_tasks.class.php
Expand Up @@ -275,7 +275,7 @@ function getRoles($id, $userid=0) {
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);
}

Expand Down Expand Up @@ -432,7 +432,7 @@ function put($id, $request_data = NULL) {
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) {
Expand Down Expand Up @@ -467,7 +467,7 @@ function delete($id)
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);
}

Expand Down

0 comments on commit 88b456a

Please sign in to comment.