We always been returning an int for for accepted, but since it was
returned as a mixed from the DB, psalm never complained about the fact
this was typed as a bool in the API doc.
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
This removes all the read after write and we don't need to queries all
the time the same share in the same request anymore.
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
This can happen in various scenarios, we should allow the user to delete
the share in this situation.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
When creating public links from federated shares, users should be able to set
the 'Hide download' option independently as long as they are more restrictive
than the original share permissions.
Previously, the `checkInheritedAttributes` method was ignoring user preferences
and always overriding the hideDownload setting based solely on inherited
permissions, preventing users from disabling downloads even when the parent
share allowed them.
This fix implements some sort of inheritance logic:
- Users can only be MORE restrictive than parent shares, never LESS restrictive
- If parent hides downloads -> child MUST hide downloads (enforced)
- If parent allows downloads -> child can CHOOSE to hide or allow downloads
- If parent forbids downloads entirely -> child cannot enable downloads
Signed-off-by: nfebe <fenn25.fn@gmail.com>
The password param should never be sent if the intention is not
remove it or update it.
This commit adapts the frontend and backend to this rule to avoid weird bugs
especially around updating new shares.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
This allows the admin to control the behavior whether link shares with
READ permissions should be extended to also gain SHARE permissions,
allowing users (public share receivers) to add the share to their cloud.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
In this case we do not want the application DI container because we are
requesting classes from other applications, so it’s better to ask the
server container. We use \OCP\Server::get for this.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Remove duplicate activity publishing from share controller download,
listen to BeforeZipCreatedEvent to publish activity for folders, and
cache folders activity to avoid sending activity for each file in the
folder.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
When a user receives a share with share-permissions but also with
download restrictions (hide download or the modern download permission attribute),
then re-shares of that share must always also include those restrictions.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Given:
User creates a link or email share with permissions=4 (create only = file drop).
Problem:
Currently the permissions are automatically extended to permissions = 5
(READ + CREATE). Work around was to create the share and directly update
it.
Solution:
Respect what the user is requesting, create a file drop share.
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>