Fix story picture definition

This commit is contained in:
Romain Neutron
2012-09-14 11:43:08 +02:00
parent b5079ffacf
commit a8209d8c1c
3 changed files with 20 additions and 10 deletions

View File

@@ -90,6 +90,7 @@ return call_user_func(
if ($subdefObj->get_class() == 'thumbnail') { if ($subdefObj->get_class() == 'thumbnail') {
$all_access = true; $all_access = true;
} }
break;
} }
} }
} }

View File

@@ -198,6 +198,14 @@ class ACL implements cache_cacheableInterface
public function has_access_to_subdef(record_Interface $record, $subdef_name) public function has_access_to_subdef(record_Interface $record, $subdef_name)
{ {
if ($subdef_name == 'thumbnail') {
return true;
}
if ($record->is_grouping()) {
return true;
}
try { try {
$subdef_class = $record->get_databox()->get_subdef_structure() $subdef_class = $record->get_databox()->get_subdef_structure()
->get_subdef($record->get_type(), $subdef_name) ->get_subdef($record->get_type(), $subdef_name)
@@ -205,6 +213,7 @@ class ACL implements cache_cacheableInterface
} catch (Exception $e) { } catch (Exception $e) {
return false; return false;
} }
$granted = false; $granted = false;
if ($subdef_class == databox_subdef::CLASS_THUMBNAIL) { if ($subdef_class == databox_subdef::CLASS_THUMBNAIL) {
@@ -215,7 +224,7 @@ class ACL implements cache_cacheableInterface
$granted = true; $granted = true;
} elseif ($subdef_class == databox_subdef::CLASS_DOCUMENT && $this->has_right_on_base($record->get_base_id(), 'candwnldhd')) { } elseif ($subdef_class == databox_subdef::CLASS_DOCUMENT && $this->has_right_on_base($record->get_base_id(), 'candwnldhd')) {
$granted = true; $granted = true;
} elseif ($subdef_class == databox_subdef::CLASS_DOCUMENT && $user->ACL()->has_hd_grant($record)) { } elseif ($subdef_class == databox_subdef::CLASS_DOCUMENT && $this->has_hd_grant($record)) {
$granted = true; $granted = true;
} }

View File

@@ -1053,7 +1053,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$subdef_def = $this->get_databox()->get_subdef_structure()->get_subdef($type, $name); $subdef_def = $this->get_databox()->get_subdef_structure()->get_subdef($type, $name);
if ($this->has_subdef($name) && ! $this->get_subdef($name)->is_substituted()) { if ($this->has_subdef($name) && $this->get_subdef($name)->is_physically_present()) {
$path_file_dest = $this->get_subdef($name)->get_pathfile(); $path_file_dest = $this->get_subdef($name)->get_pathfile();
$this->get_subdef($name)->remove_file(); $this->get_subdef($name)->remove_file();