mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
[Sharing] Files should not have create permissions
This commit is contained in:
parent
0b5b4a5eea
commit
b033a8e731
1 changed files with 11 additions and 4 deletions
|
@ -213,13 +213,17 @@ ShareWidget::ShareWidget(QSharedPointer<Share> share,
|
|||
QMenu *menu = new QMenu(this);
|
||||
_permissionCreate = new QAction(tr("create"), this);
|
||||
_permissionCreate->setCheckable(true);
|
||||
menu->addAction(_permissionCreate);
|
||||
_permissionUpdate = new QAction(tr("change"), this);
|
||||
_permissionUpdate->setCheckable(true);
|
||||
menu->addAction(_permissionUpdate);
|
||||
_permissionDelete = new QAction(tr("delete"), this);
|
||||
_permissionDelete->setCheckable(true);
|
||||
|
||||
menu->addAction(_permissionUpdate);
|
||||
/*
|
||||
* Files can't have create or delete permissions
|
||||
*/
|
||||
if (!_isFile) {
|
||||
menu->addAction(_permissionCreate);
|
||||
menu->addAction(_permissionDelete);
|
||||
}
|
||||
_ui->permissionToolButton->setMenu(menu);
|
||||
|
@ -266,10 +270,13 @@ void ShareWidget::slotEditPermissionsChanged()
|
|||
}
|
||||
|
||||
if (_ui->permissionsEdit->checkState() == Qt::Checked) {
|
||||
permissions |= Share::PermissionCreate;
|
||||
permissions |= Share::PermissionUpdate;
|
||||
|
||||
/*
|
||||
* Files can't have create or delete permisisons
|
||||
*/
|
||||
if (!_isFile) {
|
||||
permissions |= Share::PermissionCreate;
|
||||
permissions |= Share::PermissionDelete;
|
||||
}
|
||||
}
|
||||
|
@ -350,7 +357,7 @@ void ShareWidget::displayPermissions()
|
|||
_permissionUpdate->setChecked(true);
|
||||
_ui->permissionsEdit->setCheckState(Qt::Checked);
|
||||
}
|
||||
if (_share->getPermissions() & Share::PermissionCreate) {
|
||||
if (!_isFile && _share->getPermissions() & Share::PermissionCreate) {
|
||||
_permissionCreate->setChecked(true);
|
||||
_ui->permissionsEdit->setCheckState(Qt::Checked);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue