Merge pull request #1552 from ONLYOFFICE/feature/room-download

Feature/room download
This commit is contained in:
Alexey Safronov 2023-07-17 14:46:00 +04:00 committed by GitHub
commit 22335d9231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1641,6 +1641,7 @@ class FilesStore {
const canCopy = item.security?.Copy;
const canDuplicate = item.security?.Duplicate;
const canDownload = item.security?.Download;
if (isFile) {
const shouldFillForm = item.viewAccessability.WebRestrictedEditing;
@ -1700,6 +1701,10 @@ class FilesStore {
"delete",
];
if (!canDownload) {
fileOptions = this.removeOptions(fileOptions, ["download"]);
}
if (!isPdf || !window.DocSpaceConfig.pdfViewer) {
fileOptions = this.removeOptions(fileOptions, ["pdf-view"]);
}
@ -1909,6 +1914,7 @@ class FilesStore {
"mute-room",
"unmute-room",
"separator1",
"download",
"archive-room",
"unarchive-room",
"delete",
@ -1936,8 +1942,11 @@ class FilesStore {
roomOptions = this.removeOptions(roomOptions, ["delete"]);
}
if (!canArchiveRoom && !canRemoveRoom) {
roomOptions = this.removeOptions(roomOptions, ["separator1"]);
if (!canDownload) {
roomOptions = this.removeOptions(roomOptions, [
"separator1",
"download",
]);
}
if (!item.providerKey) {
@ -2015,6 +2024,10 @@ class FilesStore {
"delete",
];
if (!canDownload) {
folderOptions = this.removeOptions(folderOptions, ["download"]);
}
if (!canRenameItem) {
folderOptions = this.removeOptions(folderOptions, ["rename"]);
}