# Zones marquees MODIF dans : categories/class/api_categories.class (12.06.2024 18.10).php # Fichier actif correspondant : categories/class/api_categories.class.php ... 304 | Categorie::TYPE_CONTACT, 305 | Categorie::TYPE_CUSTOMER, 306 | Categorie::TYPE_SUPPLIER, 307 | Categorie::TYPE_MEMBER, 308 | Categorie::TYPE_PROJECT, 309 | Categorie::TYPE_KNOWLEDGEMANAGEMENT, 310 | // MODIF JOSE 311 | Categorie::TYPE_ACTIONCOMM 312 | ])) { 313 | throw new RestException(401); 314 | } 315 | 316 | if ($type == Categorie::TYPE_PRODUCT && !(DolibarrApiAccess::$user->rights->produit->lire || DolibarrApiAccess::$user->rights->service->lire)) { 317 | throw new RestException(401); 318 | } elseif ($type == Categorie::TYPE_CONTACT && !DolibarrApiAccess::$user->rights->contact->lire) { ... 324 | } elseif ($type == Categorie::TYPE_MEMBER && !DolibarrApiAccess::$user->rights->adherent->lire) { 325 | throw new RestException(401); 326 | } elseif ($type == Categorie::TYPE_PROJECT && !DolibarrApiAccess::$user->rights->projet->lire) { 327 | throw new RestException(401); 328 | } elseif ($type == Categorie::TYPE_KNOWLEDGEMANAGEMENT && !DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) { 329 | throw new RestException(401); 330 | // MODIF JOSE 331 | // elseif ($type == Categorie::TYPE_ACTIONCOMM && !DolibarrApiAccess::$user->rights->produit->lire) { 332 | // throw new RestException(401); 333 | } 334 | 335 | $categories = $this->category->getListForItem($id, $type, $sortfield, $sortorder, $limit, $page); 336 | 337 | if (!is_array($categories)) { 338 | if ($categories == 0) { ... 392 | $object = new Contact($this->db); 393 | } elseif ($type === Categorie::TYPE_MEMBER) { 394 | if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) { 395 | throw new RestException(401); 396 | } 397 | $object = new Adherent($this->db); 398 | // MODIF JOSE START 399 | } elseif ($type === Categorie::TYPE_ACTIONCOMM) { 400 | if (!DolibarrApiAccess::$user->rights->produit->creer) { 401 | throw new RestException(401); 402 | } 403 | // error_log("linkObjectById Actioncomm = ".print_r($type,1),1,"jose.martinez@pichinov.com"); 404 | $object = new Actioncomm($this->db); 405 | // MODIF JOSE END */ 406 | } else { 407 | throw new RestException(401, "this type is not recognized yet."); 408 | } 409 | 410 | if (!empty($object)) { 411 | $result = $object->fetch($object_id); 412 | if ($result > 0) { 413 | $result = $this->category->add_type($object, $type);