Fix: check security

This commit is contained in:
Regis Houssin 2017-10-03 19:09:46 +02:00
parent 4537e5472b
commit 45de1ca21e
4 changed files with 16 additions and 0 deletions

View File

@ -374,6 +374,10 @@ class Members extends DolibarrApi
*/
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
{
if (! DolibarrApiAccess::$user->rights->categorie->lire) {
throw new RestException(401);
}
$categories = new Categorie($this->db);
$result = $categories->getListForItem($id, 'member', $sortfield, $sortorder, $limit, $page);

View File

@ -265,6 +265,10 @@ class Products extends DolibarrApi
*/
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
{
if (! DolibarrApiAccess::$user->rights->categorie->lire) {
throw new RestException(401);
}
$categories = new Categorie($this->db);
$result = $categories->getListForItem($id, 'product', $sortfield, $sortorder, $limit, $page);

View File

@ -336,6 +336,10 @@ class Contacts extends DolibarrApi
*/
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
{
if (! DolibarrApiAccess::$user->rights->categorie->lire) {
throw new RestException(401);
}
$categories = new Categorie($this->db);
$result = $categories->getListForItem($id, 'contact', $sortfield, $sortorder, $limit, $page);

View File

@ -269,6 +269,10 @@ class Thirdparties extends DolibarrApi
*/
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
{
if (! DolibarrApiAccess::$user->rights->categorie->lire) {
throw new RestException(401);
}
$categories = new Categorie($this->db);
$result = $categories->getListForItem($id, 'customer', $sortfield, $sortorder, $limit, $page);