mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 13:25:52 +03:00
Add role for resharing allowed in share model
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
c05e1920bb
commit
acb22b1684
2 changed files with 5 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "account.h"
|
||||
#include "folderman.h"
|
||||
#include "sharepermissions.h"
|
||||
#include "theme.h"
|
||||
|
||||
namespace {
|
||||
|
@ -141,6 +142,7 @@ QHash<int, QByteArray> ShareModel::roleNames() const
|
|||
roles[IsSharePermissionsChangeInProgress] = "isSharePermissionChangeInProgress";
|
||||
roles[HideDownloadEnabledRole] = "hideDownload";
|
||||
roles[IsHideDownloadEnabledChangeInProgress] = "isHideDownloadInProgress";
|
||||
roles[ResharingAllowedRole] = "resharingAllowed";
|
||||
|
||||
return roles;
|
||||
}
|
||||
|
@ -241,6 +243,8 @@ QVariant ShareModel::data(const QModelIndex &index, const int role) const
|
|||
|| (share->getShareType() == Share::TypeLink && _accountState->account()->capabilities().sharePublicLinkEnforcePassword()));
|
||||
case EditingAllowedRole:
|
||||
return share->getPermissions().testFlag(SharePermissionUpdate);
|
||||
case ResharingAllowedRole:
|
||||
return share->getPermissions().testFlag(SharePermissionShare);
|
||||
|
||||
// Deal with roles that only return certain values for link or user/group share types
|
||||
case NoteEnabledRole:
|
||||
|
|
|
@ -62,6 +62,7 @@ public:
|
|||
IsSharePermissionsChangeInProgress,
|
||||
HideDownloadEnabledRole,
|
||||
IsHideDownloadEnabledChangeInProgress,
|
||||
ResharingAllowedRole,
|
||||
};
|
||||
Q_ENUM(Roles)
|
||||
|
||||
|
|
Loading…
Reference in a new issue