2 namespace TYPO3\CMS\Install\Updates;
25 protected $title =
'Set the "Files:replace" permission for all BE user/groups with "Files:write" set';
38 $description =
'A new file permission was introduced regarding replacing files.' .
39 ' This update sets "Files:replace" for all BE users/groups with the permission "Files:write".';
40 $updateNeeded =
false;
44 $notMigratedRowsCount = $db->exec_SELECTcountRows(
49 if ($notMigratedRowsCount > 0) {
55 $notMigratedRowsCount = $db->exec_SELECTcountRows(
60 if ($notMigratedRowsCount > 0) {
79 $tablesToProcess = [
'be_groups',
'be_users'];
80 foreach ($tablesToProcess as $table) {
82 foreach ($records as $singleRecord) {
84 'file_permissions' => $singleRecord[
'file_permissions'] .
',replaceFile'
86 $db->exec_UPDATEquery($table,
'uid=' . (
int)$singleRecord[
'uid'], $updateArray);
88 $dbQueries[] = str_replace(chr(10),
' ', $db->debug_lastBuiltQuery);
90 if ($db->sql_error()) {
91 $customMessages =
'SQL-ERROR: ' . htmlspecialchars($db->sql_error());
108 $fields = implode(
',', array(
'uid',
'file_permissions'));
120 return 'file_permissions LIKE \'%writeFile%\' AND file_permissions LIKE \'%replaceFile%\'';