Merge pull request #1209 from nlegoff/patch-387

[3.8.7] Fix some easy pick
This commit is contained in:
Nicolas Le Goff
2015-01-21 17:19:02 +01:00
35 changed files with 451 additions and 377 deletions

View File

@@ -1460,6 +1460,7 @@ class API_V1_adapter extends API_V1_Abstract
return null;
}
if ($this->app['authentication']->isAuthenticated()) {
if ($media->get_name() !== 'document' && false === $this->app['authentication']->getUser()->ACL()->has_access_to_subdef($record, $media->get_name())) {
return null;
@@ -1470,6 +1471,17 @@ class API_V1_adapter extends API_V1_Abstract
}
}
$databox = $record->get_databox();
try {
$subDefDefinition = $databox->get_subdef_structure()->get_subdef($record->get_type(), $media->get_name());
} catch (Exception_Databox_SubdefNotFound $e) {
return null;
}
if (false === $subDefDefinition->is_downloadable()) {
return null;
}
if ($media->get_permalink() instanceof media_Permalink_Adapter) {
$permalink = $this->list_permalink($media->get_permalink(), $registry);
} else {