nextcloud/approval

Check if file is already accessible by user

meichthys opened this issue · 2 comments

Currently requesting approval will share the file with the approving user. It would be helpful if the file was not shared if the file is already accessible by the approving user (i.e. the file is inside an SMB share that the user already has access to via the External Storage integration)

There already is a check done there:

foreach ($rule['approvers'] as $approver) {
if ($approver['type'] === 'user' && !$this->utilsService->userHasAccessTo($fileId, $approver['entityId'])) {
// create user share
if ($this->utilsService->createShare($node, IShare::TYPE_USER, $approver['entityId'], $userId, $label)) {
$createdShares[] = $approver;
}
}
}

So the file is actually not shared if the approver can access it via the main storage.
But apparently it does not work with external storages. This requires a little investigation. To be continued.

There already is a check done there:

foreach ($rule['approvers'] as $approver) {
if ($approver['type'] === 'user' && !$this->utilsService->userHasAccessTo($fileId, $approver['entityId'])) {
// create user share
if ($this->utilsService->createShare($node, IShare::TYPE_USER, $approver['entityId'], $userId, $label)) {
$createdShares[] = $approver;
}
}
}

So the file is actually not shared if the approver can access it via the main storage.
But apparently it does not work with external storages. This requires a little investigation. To be continued.

Is there a plan for when "To be continued" can be implemented? Сorrect work with external storages (CIFS) is very necessary.