mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 04:55:48 +03:00
Apply server default permissions for federated file sharing too.
See nextcloud/server#24729 comments. Signed-off-by: Camila <hello@camila.codes>
This commit is contained in:
parent
8f847906c6
commit
df38e5c08b
1 changed files with 22 additions and 32 deletions
|
@ -372,40 +372,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;
|
||||
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(), 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;
|
||||
}
|
||||
}
|
||||
|
||||
_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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue