/** * Delete skeleton * * @param int $id Skeleton ID * @return array * * @url DELETE skeleton/{id} */ function delete($id) { if (!DolibarrApiAccess::$user->rights->skeleton->supprimer) { throw new RestException(401); } $result = $this->skeleton->fetch($id); if (!$result) { throw new RestException(404, 'Skeleton not found'); } if (!DolibarrApi::_checkAccessToResource('skeleton', $this->skeleton->id)) { throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } if (!$this->skeleton->delete($id)) { throw new RestException(500); } return array('success' => array('code' => 200, 'message' => 'Skeleton deleted')); }