Prevent renaming/deleting mount points
Fixed permissions returned for mount points to not include update and delete permissions. Fixes #5291
This commit is contained in:
parent
8c25b5a0c1
commit
5f249e1a54
|
@ -904,7 +904,8 @@ class View {
|
||||||
$permissions = $subStorage->getPermissions($rootEntry['path']);
|
$permissions = $subStorage->getPermissions($rootEntry['path']);
|
||||||
$subPermissionsCache->set($rootEntry['fileid'], $user, $permissions);
|
$subPermissionsCache->set($rootEntry['fileid'], $user, $permissions);
|
||||||
}
|
}
|
||||||
$rootEntry['permissions'] = $permissions;
|
// do not allow renaming/deleting the mount point
|
||||||
|
$rootEntry['permissions'] = $permissions & (\OCP\PERMISSION_ALL - (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_DELETE));
|
||||||
|
|
||||||
//remove any existing entry with the same name
|
//remove any existing entry with the same name
|
||||||
foreach ($files as $i => $file) {
|
foreach ($files as $i => $file) {
|
||||||
|
|
Loading…
Reference in New Issue