Fix: check security
This commit is contained in:
parent
4537e5472b
commit
45de1ca21e
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user