From 5f32d17158117a5ba5802bef20b8fe3868ad896e Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 5 Aug 2022 16:21:01 +0200 Subject: [PATCH] Fix : permission error on category view --- htdocs/categories/viewcat.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 5450127bff3..3fc42bb2818 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -952,7 +952,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { } // List of Project -if ($type == Categorie::TYPE_PROJECT) { +if ($type == Categorie::TYPE_PROJECT ) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $permission = $user->rights->projet->creer; @@ -1030,7 +1030,7 @@ if ($type == Categorie::TYPE_PROJECT) { } // List of users -if ($type == Categorie::TYPE_USER) { +if ($type == Categorie::TYPE_USER && $user->hasRight("user", "user", "read")) { require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $users = $object->getObjectsInCateg($type); @@ -1099,6 +1099,9 @@ if ($type == Categorie::TYPE_USER) { print ''."\n"; } +} else { + print_barre_liste($langs->trans("Users"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'user'); + accessforbidden($langs->trans("NotEnoughPermissions"), 0, 0); }