Pending and deleted shares are not mounted into the user's filesystem, so
generic file operations like delete or download produced a misleading
"file is not available" error.
These shares now carry no permissions, so every permission-aware action
hides itself automatically, without the files app having to special-case
each view. Conversion additionally requires read permission, matching the
server-side readability check.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
fix(files_sharing): clear the password after saving
Signed-off-by: Kent Delante <kent@delante.me>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
- fixes https://github.com/nextcloud/server/issues/60163
The strings are already escaped by Vue so no need to escape in the
translation method, this will cause double escaping.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
When a new share is saved it is first created in the backend and then
updated with some additional attributes set in the frontend. If custom
tokens are enabled the attributes to update also include the token.
However, for new shares the token is set by the backend when it is
created, it is not defined by the frontend, so the token returned by the
backend needs to be copied to the share data in the frontend. Otherwise
the update would fail because an empty token is sent.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Pre-declare newPassword on the share state so Vue 2's reactivity covers
it from the start. Without this, $set later relies on a
property-addition notification path that races with the toggle's async
setter and intermittently drops the password in certain build
environments.
Fixes: #57011
-e
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
The password guard now blocks the save when a new public share is
missing a password. Non-public shares (user/group) are never blocked
by this guard, so they remain unaffected.
Tests invoke the real saveShare method against a stubbed context and
cover the save-twice symptom and the non-public-share regression.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
Set passwordProtectedState explicitly when initializing shares with
default passwords. This ensures the checkbox state is tracked
independently of the password value, preventing it from unchecking
when the password field is cleared.
Also block saving new shares when password protection is enabled but
no password is entered, regardless of enforcement settings.
Added passWithNoTests to vitest configs to handle Vue 2/3 dual
frontend test runs gracefully.
Fixes: #57732, #57011
Signed-off-by: nfebe <fenn25.fn@gmail.com>
API response sometimes includes `null` for unset, but unset
(`undefined`) is something different than `null`.
So if `null` is passed we mean `undefined` instead.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
- fix https://github.com/nextcloud/server/issues/58359
To reproduce:
1. Setup password policy.
2. Try to set a share password like `1234`
3. See that no visual error message is show but only in the console
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Add config option shareapi_bundle_reshare_with_edit to include reshare
permission in "Allow editing" bundle. Default is true to maintain
backward compatibility.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
Signed-off-by: Carl Schwan <carlschwan@kde.org>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Handle backward compatibility when config.defaultPermissions includes
the SHARE permission (value 31) which was previously part of
BUNDLED_PERMISSIONS.ALL. Now that ALL no longer includes SHARE, the
comparison must strip SHARE before checking against bundled permissions.
This fixes an issue where the Advanced Settings section would be
auto-expanded for new shares, causing a toggle to close it instead
of opening it.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
Remove PERMISSION_SHARE from bundled permissions for ALL and ALL_FILE.
Update quick share selector to consistently strip share permission
when comparing, ensuring backwards compatibility with existing shares.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
The backend returns type 'dir' for folders (from FileInfo::TYPE_FOLDER),
but the frontend expects 'folder'. This mismatch caused federated shared
folders to display incorrectly as files in the "Shared with you" view.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
When `showFederatedSharesToTrustedServersAsInternal` is enabled, the
trusted server filter was incorrectly applied to both internal and
external sharing sections. This prevented users from sharing with
federated users on non-trusted servers via the external share UI.
The filter now only applies to the internal section, allowing
non-trusted federated shares to appear in the external section.
Fixes: https://github.com/nextcloud/server/issues/56622
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 API was deprecated in Nextcloud 23.
It was replaced with `OCA.Sharing.ExternalShareAction` which now have a proper API
by using `registerSidebarAction` from `@nextcloud/sharing` instead.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
When `show_federated_shares_to_trusted_servers_as_internal` is enabled
but `show_federated_shares_as_internal` is not, filter federated share
suggestions to only include trusted servers. Previously, searching for
an email address would suggest non-trusted federated servers.
Resolved: #54511
Signed-off-by: nfebe <fenn25.fn@gmail.com>