Removed option MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES. The

implmentation did not make any test on subsidiaries. It has same effect
than being an internal user.
This commit is contained in:
Laurent Destailleur 2021-03-19 00:00:06 +01:00
parent e9f9cf62af
commit 78aec3daae
2 changed files with 2 additions and 2 deletions

View File

@ -621,7 +621,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
}
} elseif (in_array($feature, $checksoc)) { // We check feature = checksoc
// If external user: Check permission for external users
if ($user->socid > 0 && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES)) {
if ($user->socid > 0) {
if ($user->socid <> $objectid) {
return false;
}

View File

@ -80,7 +80,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int');
if ($user->socid && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES)) {
if ($user->socid) {
$socid = $user->socid;
}
if (empty($socid) && $action == 'view') {