mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-17 19:31:48 +03:00
Move permissions to OcsShareJob
This commit is contained in:
parent
03719334ea
commit
f95fea9866
2 changed files with 15 additions and 10 deletions
|
@ -39,6 +39,18 @@ public:
|
|||
LINK = 3
|
||||
};
|
||||
|
||||
/**
|
||||
* Possible permissions
|
||||
*/
|
||||
enum class PERMISSION : int {
|
||||
READ = 1,
|
||||
UPDATE = 2,
|
||||
CREATE = 4,
|
||||
DELETE = 8,
|
||||
SHARE = 16,
|
||||
ALL = 31
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructor for new shares or listing of shares
|
||||
*/
|
||||
|
|
|
@ -32,15 +32,6 @@
|
|||
#include <QClipboard>
|
||||
#include <QFileInfo>
|
||||
|
||||
namespace {
|
||||
// int PERMISSION_READ = 1;
|
||||
int PERMISSION_UPDATE = 2;
|
||||
int PERMISSION_CREATE = 4;
|
||||
// int PERMISSION_DELETE = 8;
|
||||
// int PERMISSION_SHARE = 16;
|
||||
// int PERMISSION_ALL = 31;
|
||||
}
|
||||
|
||||
namespace OCC {
|
||||
|
||||
ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QString &localPath, bool resharingAllowed, QWidget *parent) :
|
||||
|
@ -348,7 +339,9 @@ void ShareDialog::slotSharesFetched(const QVariantMap &reply)
|
|||
* Only directories can have public upload set
|
||||
* For public links the server sets CREATE and UPDATE permissions.
|
||||
*/
|
||||
if (!_isFile && (permissions & PERMISSION_UPDATE) && (permissions & PERMISSION_CREATE)) {
|
||||
if (!_isFile &&
|
||||
(permissions & static_cast<int>(OcsShareJob::PERMISSION::UPDATE)) &&
|
||||
(permissions & static_cast<int>(OcsShareJob::PERMISSION::CREATE))) {
|
||||
_ui->checkBox_editing->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue