Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2021-03-12 12:44:25 +01:00
commit 777ba369c4
2 changed files with 3 additions and 3 deletions

View File

@ -620,8 +620,8 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
}
}
} elseif (in_array($feature, $checksoc)) { // We check feature = checksoc
if ($user->socid > 0) {
// If external user: Check permission for external users
// 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 <> $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) {
if ($user->socid && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES)) {
$socid = $user->socid;
}
if (empty($socid) && $action == 'view') {