You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the group_folders app (and file_versions) in my Nextcloud.
User A is a member of group G, which has a group folder.
User A shares a subdirectory of the group folder with group H (read-write).
User B is a member of group H, so can see the share,
User B opens a docx file in the shared folder, edits it, and attempts to save it.
The save fails.
I have spent a couple of days tracking down the issue. It appears to be in callbackcontroller.php function track.
Extract from code:
$user = $this->userManager->get($userId);
if (!empty($user)) {
\OC_User::setUserId($userId);
} else {
if (empty($shareToken)) {
$this->logger->error("Track without token: $fileId status $status", ["app" => $this->appName]);
return new JSONResponse(["message" => $this->trans->t("Access denied")], Http::STATUS_FORBIDDEN);
}
$this->logger->debug("Track $fileId by token for $userId", ["app" => $this->appName]);
}
Later on:
// owner of file from the callback link
$ownerId = $hashData->ownerId;
$owner = $this->userManager->get($ownerId);
if (!empty($owner)) {
$userId = $ownerId;
} else {
$callbackUser = $this->userManager->get($callbackUserId);
if (!empty($callbackUser)) {
// author of the callback link
$userId = $callbackUserId;
// path for author of the callback link
$filePath = $hashData->filePath;
}
}
if (!empty($userId)) {
\OC_Util::setupFS($userId);
}
Unfortunately, group folder mount points seem to be created for the user set in \OC_User::setUserId($userId); rather than the one passed to \OC_Util::setupFS($userId);.
Moving the call to \OC_User::setUserId($userId); to just before the one to \OC_Util::setupFS($userId); enables the file to be saved (but I guess might have unintended consequences if file modofications are logged to the user?).
Presumably passing the user's id instead of the owner's to setupFS would also work - is there a good reason why you set up the file system as the owner rather than the user?
The text was updated successfully, but these errors were encountered:
I have the group_folders app (and file_versions) in my Nextcloud.
User A is a member of group G, which has a group folder.
User A shares a subdirectory of the group folder with group H (read-write).
User B is a member of group H, so can see the share,
User B opens a docx file in the shared folder, edits it, and attempts to save it.
The save fails.
I have spent a couple of days tracking down the issue. It appears to be in
callbackcontroller.php
functiontrack
.Extract from code:
Later on:
Unfortunately, group folder mount points seem to be created for the user set in
\OC_User::setUserId($userId);
rather than the one passed to\OC_Util::setupFS($userId);
.Moving the call to
\OC_User::setUserId($userId);
to just before the one to\OC_Util::setupFS($userId);
enables the file to be saved (but I guess might have unintended consequences if file modofications are logged to the user?).Presumably passing the user's id instead of the owner's to
setupFS
would also work - is there a good reason why you set up the file system as the owner rather than the user?The text was updated successfully, but these errors were encountered: