Merge pull request #20435 from marc-dll/13.0_FIX_medias_access_multicompany
FIX: permit access to medias when logged in a different entity
This commit is contained in:
commit
c44cfb0885
@ -186,6 +186,13 @@ $refname = basename(dirname($original_file)."/");
|
||||
// Security check
|
||||
if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart', 0, 0, 1);
|
||||
|
||||
// When logged in a different entity, medias cannot be accessed because $conf->$module->multidir_output
|
||||
// is not set on the requested entity, but they are public documents, so reset entity
|
||||
if ($modulepart === 'medias' && $entity != $conf->entity) {
|
||||
$conf->entity = $entity;
|
||||
$conf->setValues($db);
|
||||
}
|
||||
|
||||
$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $user, $refname);
|
||||
$accessallowed = $check_access['accessallowed'];
|
||||
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user