42 $accessAllowed = $otherHookGrantedAccess;
43 if ($table ===
'sys_file_metadata' && $accessAllowed !== 0) {
44 $existingFileMetadataRecord = BackendUtility::getRecord(
'sys_file_metadata', $id);
45 if ($existingFileMetadataRecord === NULL || (empty($existingFileMetadataRecord[
'file']) && !empty($fileMetadataRecord[
'file']))) {
46 $existingFileMetadataRecord = $fileMetadataRecord;
51 return $accessAllowed;
66 if ($table ===
'sys_file_metadata') {
67 if (isset($parent->cmdmap[$table]) && is_array($parent->cmdmap[$table])) {
68 foreach ($parent->cmdmap[$table] as $id => $command) {
70 throw new \UnexpectedValueException(
71 'Integer expected for data manipulation command. 72 This can only happen in the case of an attack attempt or when something went horribly wrong. 73 To not compromise security, we exit here.',
78 $fileMetadataRecord = BackendUtility::getRecord(
'sys_file_metadata', $id);
80 if (!$accessAllowed) {
87 if (isset($parent->datamap[$table]) && is_array($parent->datamap[$table])) {
88 foreach ($parent->datamap[$table] as $id => $data) {
90 $recordAccessAllowed = FALSE;
92 if (strpos($id,
'NEW') === FALSE) {
93 $fileMetadataRecord = BackendUtility::getRecord(
'sys_file_metadata', $id);
94 if ($fileMetadataRecord !== NULL) {
95 if ($parent->isImporting && empty($fileMetadataRecord[
'file'])) {
97 $recordAccessAllowed = TRUE;
104 $recordAccessAllowed = TRUE;
107 if (isset($data[
'file'])) {
108 if ($parent->isImporting && empty($data[
'file'])) {
110 $dataAccessAllowed = TRUE;
111 } elseif (empty($data[
'file'])) {
112 $dataAccessAllowed = FALSE;
117 $dataAccessAllowed = TRUE;
120 if (!$recordAccessAllowed || !$dataAccessAllowed) {
122 $accessAllowed = FALSE;
137 $table = $parameters[
'table'];
138 $uid = $parameters[
'uid'];
139 $cmd = $parameters[
'cmd'];
140 $accessAllowed = $parameters[
'hasAccess'];
142 if ($accessAllowed && $table ===
'sys_file_metadata' && $cmd ===
'edit') {
143 $fileMetadataRecord = BackendUtility::getRecord(
'sys_file_metadata',
$uid);
146 return $accessAllowed;
156 $accessAllowed = FALSE;
157 if (is_array($fileMetadataRecord) && !empty($fileMetadataRecord[
'file'])) {
158 $file = $fileMetadataRecord[
'file'];
160 if (strpos($file,
'sys_file_') !== FALSE) {
161 $file = substr($file, strlen(
'sys_file_'));
164 $accessAllowed = $fileObject->checkActionPermission(
'write');
166 return $accessAllowed;
static canBeInterpretedAsInteger($var)