Merge pull request #16280 from bafbes/abb120358

New:Constant MAIN_SHOW_SOCIETE2EXTERN to allow access to any thirdparty for external users
This commit is contained in:
Laurent Destailleur 2021-03-12 11:14:31 +01:00 committed by GitHub
commit aee3fda3d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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') {