Issue Bug Closed

#39949Local file not editable (as admin) - User right 'edit' vs. 'update'

Andreas Kießling 08/19/12, 08:49 updated 10/23/17, 22:12

Description

When editing a local file (as admin user without any rights set up), there is a mismatch between the granted defaults and the checked permission. This results in an exception when trying to save a text file.

In t3lib_file_Storage the permission to ‘update’ is checked

    public function setFileContents(t3lib_file_AbstractFile $file, $contents) {

            // Check if user is allowed to update
        if (!$this->checkUserActionPermission('update', 'File')) {
            throw new t3lib_file_exception_InsufficientUserPermissionsException('Updating file "'
                . $file->getIdentifier() . '" not allowed for user.', 1330121117);
        }

But the default permissions in t3lib_beUserAuth->getFilePermissions do not include ‘update’, only ‘edit’

if (!isset($this->filePermissions)) {
            $defaultOptions = array(
                'addFile'  => TRUE,    // new option
                'readFile' => TRUE,    // new option, generic check of the user rights
                'editFile' => TRUE,    // new option
                'writeFile' => TRUE,    // new option, generic check of the user rights
                'uploadFile' => TRUE,
                'copyFile' => TRUE,
                'moveFile' => TRUE,
                'renameFile' => TRUE,
                'unzipFile' => TRUE,
                'removeFile' => TRUE,
                'addFolder' => TRUE,
                'browseFolder' => TRUE, // new option,, generic check of the user rights
                'moveFolder' => TRUE,
                'renameFolder' => TRUE,
                'writeFolder' => TRUE,    // new option, generic check of the user rights
                'removeFolder' => TRUE,
                'removeSubfolders' => TRUE    // was "delete recursively" previously
            );

Reviews 1