mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Added getPublicUpload to LinkShare
so the gui does not have to know abou the internal permissions
This commit is contained in:
parent
918c06aba3
commit
390daed3de
@ -96,6 +96,12 @@ LinkShare::LinkShare(AccountPtr account,
|
||||
|
||||
}
|
||||
|
||||
bool LinkShare::getPublicUpload()
|
||||
{
|
||||
return ((_permissions & OcsShareJob::Permission::Update) &&
|
||||
(_permissions & OcsShareJob::Permission::Create));
|
||||
}
|
||||
|
||||
void LinkShare::setPublicUpload(bool publicUpload)
|
||||
{
|
||||
OcsShareJob *job = new OcsShareJob(_account, this);
|
||||
|
||||
@ -112,6 +112,11 @@ public:
|
||||
*/
|
||||
const QUrl getLink();
|
||||
|
||||
/*
|
||||
* Get the publicUpload status of this share
|
||||
*/
|
||||
bool getPublicUpload();
|
||||
|
||||
/*
|
||||
* Set a share to be public upload
|
||||
* This function can only be called on link shares
|
||||
|
||||
@ -307,10 +307,8 @@ void ShareDialog::slotSharesFetched(const QList<QSharedPointer<Share>> &shares)
|
||||
* Only directories can have public upload set
|
||||
* For public links the server sets CREATE and UPDATE permissions.
|
||||
*/
|
||||
if (!_isFile &&
|
||||
(_share->getPermissions() & static_cast<int>(OcsShareJob::Permission::Update)) &&
|
||||
(_share->getPermissions() & static_cast<int>(OcsShareJob::Permission::Create))) {
|
||||
_ui->checkBox_editing->setChecked(true);
|
||||
if (!_isFile && _share->getPublicUpload()) {
|
||||
_ui->checkBox_editing->setChecked(true);
|
||||
}
|
||||
|
||||
setShareLink(_share->getLink().toString());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user