Also allow transfer ownership of files

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2019-11-27 11:47:26 +01:00 committed by Roeland Jago Douma
parent 5274c54268
commit 08a1b928aa
No known key found for this signature in database
GPG Key ID: F941078878347C0C
6 changed files with 25 additions and 16 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -91,7 +91,7 @@ class OwnershipTransferService {
Filesystem::initMountPoints($destinationUid);
$view = new View();
if (!$view->is_dir($sourcePath)) {
if (!($view->is_dir($sourcePath) || $view->is_file($sourcePath))) {
throw new TransferOwnershipException("Unknown path provided: $path", 1);
}

View File

@ -22,7 +22,16 @@
import { getCurrentUser } from '@nextcloud/auth'
import { getLoggerBuilder } from '@nextcloud/logger'
export default getLoggerBuilder()
.setApp('files')
.setUid(getCurrentUser().uid)
.build()
const getLogger = user => {
if (user === null) {
return getLoggerBuilder()
.setApp('files')
.build()
}
return getLoggerBuilder()
.setApp('files')
.setUid(user.uid)
.build()
}
export default getLogger(getCurrentUser())