Skip to content

Conversation

@mejo-
Copy link
Member

@mejo- mejo- commented Oct 24, 2023

Manual backport of #40482

This fixes workflows on groupfolders, as it will consider access to files in groupfolders.

It also fixes false positives where access to files was limited by other means not taken into account before, e.g. access control.

For postDelete events, check for permissions of the parent folder instead, as the file itself no longer exists.

Fixes: nextcloud/flow_notifications#71

Idea taken from #38946

@mejo- mejo- added the 2. developing Work in progress label Oct 24, 2023
@mejo- mejo- added this to the Nextcloud 27.1.4 milestone Oct 24, 2023
$mountInfos = $this->userMountCache->getMountsForFileId($fileId, $uid);
foreach ($mountInfos as $mountInfo) {
$mount = $this->mountManager->getMountFromMountInfo($mountInfo);
if ($mount && $mount->getStorage() && !empty($mount->getStorage()->getCache()->get($fileId))) {

Check notice

Code scanning / Psalm

PossiblyNullReference

Cannot call method getCache on possibly null value
@mejo- mejo- added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 24, 2023
@mejo- mejo- force-pushed the backport/40482/stable27 branch from d64f493 to e53bc50 Compare October 24, 2023 09:50
@mejo-
Copy link
Member Author

mejo- commented Oct 24, 2023

Manually tested on stable27.

@mejo-
Copy link
Member Author

mejo- commented Oct 24, 2023

/backport to stable26

@juliusknorr juliusknorr added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Oct 25, 2023
mejo- added 2 commits October 26, 2023 22:21
This fixes workflows on groupfolders, as it will consider access to
files in groupfolders.

It also fixes false positives where access to files was limited by other
means not taken into account before, e.g. access control.

For postDelete events, check for permissions of the parent folder
instead, as the file itself no longer exists.

Fixes: nextcloud/flow_notifications#71

Signed-off-by: Jonas <[email protected]>
@mejo- mejo- force-pushed the backport/40482/stable27 branch from e53bc50 to 9ed1bbe Compare October 26, 2023 20:21
@mejo- mejo- merged commit c7403d4 into stable27 Oct 26, 2023
@mejo- mejo- deleted the backport/40482/stable27 branch October 26, 2023 22:26
@blizzz blizzz mentioned this pull request Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish bug feature: workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants