mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
fix #PHRAS-388 #time 4h
This commit is contained in:
@@ -1460,7 +1460,6 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($this->app['authentication']->isAuthenticated()) {
|
if ($this->app['authentication']->isAuthenticated()) {
|
||||||
if ($media->get_name() !== 'document' && false === $this->app['authentication']->getUser()->ACL()->has_access_to_subdef($record, $media->get_name())) {
|
if ($media->get_name() !== 'document' && false === $this->app['authentication']->getUser()->ACL()->has_access_to_subdef($record, $media->get_name())) {
|
||||||
return null;
|
return null;
|
||||||
@@ -1470,15 +1469,16 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($media->get_name() != 'document') {
|
||||||
$databox = $record->get_databox();
|
$databox = $record->get_databox();
|
||||||
try {
|
try {
|
||||||
$subDefDefinition = $databox->get_subdef_structure()->get_subdef($record->get_type(), $media->get_name());
|
$subDefDefinition = $databox->get_subdef_structure()->get_subdef($record->get_type(), $media->get_name());
|
||||||
} catch (Exception_Databox_SubdefNotFound $e) {
|
} catch (Exception_Databox_SubdefNotFound $e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (false === $subDefDefinition->is_downloadable()) {
|
if ($media->get_name() != 'document' && false === $subDefDefinition->is_downloadable()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user