Fix permision mask

If we move a file from the temp part file to the original file we don't
need update permissions.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2016-10-22 21:29:14 +02:00
parent f374eb5f1d
commit e73a11d106
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
2 changed files with 8 additions and 0 deletions

View File

@ -78,6 +78,14 @@ class PermissionsMask extends Wrapper {
}
public function rename($path1, $path2) {
$p = strpos($path1, $path2);
if ($p === 0) {
$part = substr($path1, strlen($path2));
//This is a rename of the transfer file to the original file
if (strpos($part, '.ocTransferId') === 0) {
return $this->checkMask(Constants::PERMISSION_CREATE) and parent::rename($path1, $path2);
}
}
return $this->checkMask(Constants::PERMISSION_UPDATE) and parent::rename($path1, $path2);
}