diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index a8cb6b5de8f..e09bc905b96 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -248,7 +248,7 @@ class AgendaEvents extends DolibarrApi throw new RestException(404, 'actioncomm not found'); } - if (!DolibarrApi::_checkAccessToResource('actioncomm', $this->actioncomm->id)) { + if (!DolibarrApi::_checkAccessToResource('actioncomm', $this->actioncomm->id, 'actioncomm', '', 'fk_soc', 'id')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } foreach ($request_data as $field => $value) { @@ -290,7 +290,7 @@ class AgendaEvents extends DolibarrApi throw new RestException(404, 'Agenda Event not found'); } - if (!DolibarrApi::_checkAccessToResource('actioncomm', $this->actioncomm->id)) { + if (!DolibarrApi::_checkAccessToResource('actioncomm', $this->actioncomm->id, 'actioncomm', '', 'fk_soc', 'id')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); }