mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 17:13:03 +01:00
Fix missing test on permissions
This commit is contained in:
@@ -38,9 +38,9 @@ if (!$user->hasRight('user', 'user', 'lire') && !$user->admin) {
|
||||
// Load translation files required by page
|
||||
$langs->load("users");
|
||||
|
||||
$canreadperms = true;
|
||||
$permissiontoreadgroup = true;
|
||||
if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
|
||||
$canreadperms = (!empty($user->admin) || $user->hasRight("user", "group_advance", "read"));
|
||||
$permissiontoreadgroup = (!empty($user->admin) || $user->hasRight("user", "group_advance", "read"));
|
||||
}
|
||||
|
||||
// Security check (for external users)
|
||||
@@ -98,7 +98,7 @@ $searchbox .= '<tr><td>';
|
||||
$searchbox .= $langs->trans("User").':</td><td><input class="flat inputsearch width200" type="text" name="search_user"></td></tr>';
|
||||
|
||||
// Search Group
|
||||
if ($canreadperms) {
|
||||
if ($permissiontoreadgroup) {
|
||||
$searchbox .= '<tr><td>';
|
||||
$searchbox .= $langs->trans("Group").':</td><td><input class="flat inputsearch width200" type="text" name="search_group"></td></tr>';
|
||||
}
|
||||
@@ -231,7 +231,7 @@ if ($resql) {
|
||||
* Last groups created
|
||||
*/
|
||||
$lastgroupbox = '';
|
||||
if ($canreadperms) {
|
||||
if ($permissiontoreadgroup) {
|
||||
$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g";
|
||||
if (isModEnabled('multicompany') && $conf->entity == 1 && (getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') || ($user->admin && !$user->entity))) {
|
||||
|
||||
Reference in New Issue
Block a user