Bug #37812

Admin has no rights to update a file

Added by Stefan Froemken about 3 years ago. Updated almost 3 years ago.

Status:Resolved Start date:2012-06-07
Priority:Should have Due date:
Assigned To:Andreas Wolf % Done:

100%

Category:File Abstraction Layer (FAL) Spent time: -
Target version:6.0.0-beta2
TYPO3 Version:6.0 Is Regression:
PHP Version:5.3 Sprint Focus:
Complexity:easy

Description

Hello Core-Team,

I just have installed TYPO3 6.0 for testing FAL. There are no problems with creating files and folders but I can't modify the files content. I don't have permissions to edit this file.
I have searched a very long time because FAL is pretty hugh. I found out that you define some default permissions for BE-Users. It's an Array containing an element called "editFile", but it will be checked against "updateFile". So please update your code to "editFile", or change the element within the array to "updateFile".

For now I have added following line to BE-Userrecords TSconfig:

permissions.file.storage.1.updateFile = 1

It doesn't work, because the returning value of getTSconfig is an Array containing always to elements "value" and "properties". This is what you do:

$storageFilePermissions = $this->getTSConfig('permissions.file.storage.' . $storageObject->getUid());

it should be:

$tsConfigPath = $this->getTSConfig('permissions.file.storage.' . $storageObject->getUid());
$storageFilePermissions = $tsConfigPath['properties'];

Now the both arrays are merged correctly.

Stefan


Related issues

duplicated by Core - Bug #39860: Not possible to save edited files in fileadmin (TYPO3 6.0... Resolved 2012-08-16
duplicated by Core - Bug #39949: Local file not editable (as admin) - User right 'edit' vs... Resolved 2012-08-19

Associated revisions

Revision cfd10726
Added by Andreas Wolf almost 3 years ago

[BUGFIX] Files contents cannot be changed

Setting file contents failed for two reasons:

a) The permissions were incorrectly read from TSconfig and

b) We used a new "update" permission that was not present
in the default configuration, so without manually setting it,
a file could never be updated, even by admins.

This commit changes the "update" permission back to "edit", which was
also used in the pre-FAL era.

Change-Id: I408a19257a50868f7978ffac32eefbd410117e2d
Resolves: #37812
Resolves: #39860
Resolves: #39949
Releases: 6.0
Reviewed-on: http://review.typo3.org/14257
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel

History

#1 Updated by Gerrit Code Review almost 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14257

#2 Updated by Gerrit Code Review almost 3 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14257

#3 Updated by Gerrit Code Review almost 3 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14257

#4 Updated by Steffen Ritter almost 3 years ago

  • Target version changed from 6.0.0-alpha2 to 6.0.0-beta2

#5 Updated by Steffen Ritter almost 3 years ago

  • Assigned To set to Andreas Wolf

#6 Updated by Gerrit Code Review almost 3 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14257

#7 Updated by Anonymous almost 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF