Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCamila <hello@camila.codes>2021-08-25 13:06:42 +0300
committerMatthieu Gallien (Rebase PR Action) <matthieu_gallien@yahoo.fr>2021-09-27 11:53:45 +0300
commitdf38e5c08bb0765713fb41a850751e90374e265e (patch)
treeeb8c28a7a57b49c0dd5143482386fc6665e28db7 /src
parent8f847906c690b82f3e05690f23940740c122d158 (diff)
Apply server default permissions for federated file sharing too.
See nextcloud/server#24729 comments. Signed-off-by: Camila <hello@camila.codes>
Diffstat (limited to 'src')
-rw-r--r--src/gui/shareusergroupwidget.cpp54
1 files changed, 22 insertions, 32 deletions
diff --git a/src/gui/shareusergroupwidget.cpp b/src/gui/shareusergroupwidget.cpp
index 1ca12736b..45d2c9ec7 100644
--- a/src/gui/shareusergroupwidget.cpp
+++ b/src/gui/shareusergroupwidget.cpp
@@ -371,40 +371,30 @@ void ShareUserGroupWidget::slotCompleterActivated(const QModelIndex &index)
*/
_lastCreatedShareId = QString();
-
- if (sharee->type() == Sharee::Federated
- && _account->serverVersionInt() < Account::makeServerVersion(9, 1, 0)) {
- int permissions = SharePermissionRead | SharePermissionUpdate;
- if (!_isFile) {
- permissions |= SharePermissionCreate | SharePermissionDelete;
- }
- _manager->createShare(_sharePath, Share::ShareType(sharee->type()),
- sharee->shareWith(), SharePermission(permissions));
- } else {
- QString password;
- if (sharee->type() == Sharee::Email && _account->capabilities().shareEmailPasswordEnforced()) {
- _ui->shareeLineEdit->clear();
- // always show a dialog for password-enforced email shares
- bool ok = false;
-
- do {
- password = QInputDialog::getText(
- this,
- tr("Password for share required"),
- tr("Please enter a password for your email share:"),
- QLineEdit::Password,
- QString(),
- &ok);
- } while (password.isEmpty() && ok);
-
- if (!ok) {
- return;
- }
+
+ QString password;
+ if (sharee->type() == Sharee::Email && _account->capabilities().shareEmailPasswordEnforced()) {
+ _ui->shareeLineEdit->clear();
+ // always show a dialog for password-enforced email shares
+ bool ok = false;
+
+ do {
+ password = QInputDialog::getText(
+ this,
+ tr("Password for share required"),
+ tr("Please enter a password for your email share:"),
+ QLineEdit::Password,
+ QString(),
+ &ok);
+ } while (password.isEmpty() && ok);
+
+ if (!ok) {
+ return;
}
-
- _manager->createShare(_sharePath, Share::ShareType(sharee->type()),
- sharee->shareWith(), _maxSharingPermissions, password);
}
+
+ _manager->createShare(_sharePath, Share::ShareType(sharee->type()),
+ sharee->shareWith(), _maxSharingPermissions, password);
_ui->shareeLineEdit->setEnabled(false);
_ui->shareeLineEdit->clear();