Move permissions to OcsShareJob

This commit is contained in:
Roeland Jago Douma 2015-10-16 08:09:57 +02:00
parent 03719334ea
commit f95fea9866
2 changed files with 15 additions and 10 deletions

View file

@ -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
*/

View file

@ -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);
}
}