Merge pull request #21664 from ptibogxiv/patch-32

Fix read knowledgemanagement categories
This commit is contained in:
Laurent Destailleur 2022-08-10 04:40:45 +02:00 committed by GitHub
commit 75e31ad0ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -305,7 +305,8 @@ class Categories extends DolibarrApi
Categorie::TYPE_CUSTOMER,
Categorie::TYPE_SUPPLIER,
Categorie::TYPE_MEMBER,
Categorie::TYPE_PROJECT
Categorie::TYPE_PROJECT,
Categorie::TYPE_KNOWLEDGEMANAGEMENT
])) {
throw new RestException(401);
}
@ -322,6 +323,8 @@ class Categories extends DolibarrApi
throw new RestException(401);
} elseif ($type == Categorie::TYPE_PROJECT && !DolibarrApiAccess::$user->rights->projet->lire) {
throw new RestException(401);
} elseif ($type == Categorie::TYPE_KNOWLEDGEMANAGEMENT && !DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
throw new RestException(401);
}
$categories = $this->category->getListForItem($id, $type, $sortfield, $sortorder, $limit, $page);