Update security.lib.php

MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES
This commit is contained in:
Bahfir Abbes 2021-03-16 12:25:17 +01:00 committed by GitHub
parent e6d35039c9
commit 9c51e62d0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -584,7 +584,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
}
} elseif (!in_array($feature, $nocheck)) { // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield
// If external user: Check permission for external users
if ($user->socid > 0 && empty($conf->global->MAIN_SHOW_SOCIETE2EXTERN))
if ($user->socid > 0 && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES))
{
if (empty($dbt_keyfield)) dol_print_error('', 'Param dbt_keyfield is required but not defined');
$sql = "SELECT COUNT(dbt.".$dbt_keyfield.") as nb";