Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update child share permissions
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl authored and backportbot[bot] committed May 13, 2025
commit ea3032c854d5f0b9c8c145ce471f0cf34f9c765a
16 changes: 16 additions & 0 deletions lib/Db/ShareWrapperRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ public function update(ShareWrapper $shareWrapper): void {
$qb->execute();
}

/**
* update permissions and attributes from child
*/
public function updateChildPermissions(ShareWrapper $shareWrapper): void {
$qb = $this->getShareUpdateSql();
$shareAttributes = $this->formatShareAttributes($shareWrapper->getAttributes());

$qb->set('permissions', $qb->createNamedParameter($shareWrapper->getPermissions()))
->set('attributes', $qb->createNamedParameter($shareAttributes));

$qb->limitToShareParent((int)$shareWrapper->getId());
$qb->gt('permissions', 0);

$qb->execute();
}


/**
* @param Membership $membership
Expand Down
4 changes: 4 additions & 0 deletions lib/Service/ShareWrapperService.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public function update(ShareWrapper $shareWrapper): void {
$this->shareWrapperRequest->update($shareWrapper);
}

public function updateChildPermissions(ShareWrapper $shareWrapper): void {
$this->cache->clear('');
$this->shareWrapperRequest->updateChildPermissions($shareWrapper);
}

/**
* @param ShareWrapper $shareWrapper
Expand Down
1 change: 1 addition & 0 deletions lib/ShareByCircleProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public function update(IShare $share): IShare {
->setShareNote($share->getNote());

$this->shareWrapperService->update($wrappedShare);
$this->shareWrapperService->updateChildPermissions($wrappedShare);

return $wrappedShare->getShare($this->rootFolder, $this->userManager, $this->urlGenerator);
}
Expand Down
Loading