Bug 78627

This commit is contained in:
Julia.Radzhabova
2025-11-21 17:43:48 +03:00
parent 4d235ad893
commit 8f73af3133
41 changed files with 121 additions and 23 deletions

View File

@ -912,6 +912,10 @@ DE.ApplicationController = new(function(){
case Asc.c_oAscError.ID.SessionToken: // don't show error message
return;
case Asc.c_oAscError.ID.CopyDisabled:
message= me.errorCopyDisabled;
break;
default:
// message = me.errorDefaultMessage.replace('%1', id);
// break;
@ -1201,6 +1205,7 @@ DE.ApplicationController = new(function(){
textCancel: 'Cancel',
txtSecurityWarningLink: 'This document is trying to connect to %1.<br>If you trust this site, press \"OK\" while holding down the ctrl key.',
txtSecurityWarningOpenFile: 'This document is trying to open file dialog, press \"OK\" to open.',
txtSecurityWarningLinkOk: 'This document is trying to connect to %1.<br>If you trust this site, press \"OK\".'
txtSecurityWarningLinkOk: 'This document is trying to connect to %1.<br>If you trust this site, press \"OK\".',
errorCopyDisabled: 'For security reasons, the contents of this document cannot be copied to the clipboard.'
}
})();

View File

@ -63,6 +63,7 @@
"DE.ApplicationController.waitText": "Please, wait...",
"DE.ApplicationController.warnLicenseBefore": "License not active. Please contact your administrator.",
"DE.ApplicationController.warnLicenseExp": "Your license has expired. Please update your license and refresh the page.",
"DE.ApplicationController.errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard.",
"DE.ApplicationView.txtDownload": "Download",
"DE.ApplicationView.txtDownloadDocx": "Download as DOCX",
"DE.ApplicationView.txtDownloadPdf": "Download as PDF",

View File

@ -353,6 +353,11 @@ define([
config.msg = this.errorInconsistentExt;
break;
case Asc.c_oAscError.ID.CopyDisabled:
config.maxwidth = 450;
config.msg = this.errorCopyDisabled;
break;
default:
config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id);
if (typeof id == 'string')
@ -673,6 +678,7 @@ define([
this.appOptions.canDownload = this.permissions.download !== false;
this.appOptions.canPrint = (this.permissions.print !== false);
this.appOptions.canCopy = this.permissions.copy !== false;
this.appOptions.fileKey = this.document.key;
this.appOptions.isAnonymousSupport = !!this.api.asc_isAnonymousSupport();
@ -2112,7 +2118,7 @@ define([
if (this.api) {
var res = (item.value == 'cut') ? this.api.Cut() : ((item.value == 'copy') ? this.api.Copy() : this.api.Paste());
if (!res) {
if (!Common.localStorage.getBool("de-forms-hide-copywarning")) {
if (!Common.localStorage.getBool("de-forms-hide-copywarning") && (item.value === 'paste' || this.appOptions.canCopy)) {
(new Common.Views.CopyWarningDialog({
handler: function(dontshow) {
if (dontshow) Common.localStorage.setItem("de-forms-hide-copywarning", 1);
@ -2393,6 +2399,7 @@ define([
titleReadOnly: 'Read-Only Mode',
textContinue: 'Continue',
txtSignedForm: 'This document has been signed and cannot be edited.',
errorCopyDisabled: 'For security reasons, the contents of this document cannot be copied to the clipboard.'
}, DE.Controllers.ApplicationController));
});

View File

@ -178,6 +178,7 @@
"DE.Controllers.ApplicationController.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
"DE.Controllers.ApplicationController.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
"DE.Controllers.ApplicationController.warnStartFilling": "Form filling is in progress.<br>File editing is not currently available.",
"DE.Controllers.ApplicationController.errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard.",
"DE.Views.ApplicationView.textClear": "Clear all fields",
"DE.Views.ApplicationView.textClearField": "Clear field",
"DE.Views.ApplicationView.textClose": "Close file",

View File

@ -1303,7 +1303,7 @@ define([
me.hidePreloader();
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
if (!this.appOptions.canCopy)
if (!me.appOptions.canCopy)
Common.UI.TooltipManager.showTip({ step: 'copyDisabled', text: me.errorCopyDisabled, target: '#toolbar', maxwidth: 350, automove: true, noHighlight: true, noArrow: true, showButton: false});
Common.Utils.InternalSettings.set("de-settings-datetime-default", Common.localStorage.getItem("de-settings-datetime-default"));

View File

@ -488,7 +488,8 @@
"uploadDocSizeMessage": "Maximum document size limit exceeded.",
"uploadImageExtMessage": "Unknown image format.",
"uploadImageFileCountMessage": "No images uploaded.",
"uploadImageSizeMessage": "The image is too big. The maximum size is 25 MB."
"uploadImageSizeMessage": "The image is too big. The maximum size is 25 MB.",
"errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard."
},
"LongActions": {
"applyChangesTextText": "Loading data...",

View File

@ -15,6 +15,7 @@ import EditorUIController from '../lib/patch';
canCoAuthoring: stores.storeAppOptions.canCoAuthoring,
canReview: stores.storeAppOptions.canReview,
canFillForms: stores.storeAppOptions.canFillForms,
canCopy: stores.storeAppOptions.canCopy,
users: stores.users,
isDisconnected: stores.users.isDisconnected,
displayMode: stores.storeReview.displayMode,
@ -92,11 +93,11 @@ class ContextMenu extends ContextMenuController {
const api = Common.EditorApi.get();
switch (action) {
case 'cut':
if ( !LocalStorage.getBool("de-hide-copy-cut-paste-warning") )
if ( !LocalStorage.getBool("de-hide-copy-cut-paste-warning") && this.props.canCopy )
this.showCopyCutPasteModal();
break;
case 'copy':
if (!api.Copy() && !LocalStorage.getBool("de-hide-copy-cut-paste-warning") )
if (!api.Copy() && !LocalStorage.getBool("de-hide-copy-cut-paste-warning") && this.props.canCopy )
this.showCopyCutPasteModal();
break;
case 'paste':

View File

@ -263,6 +263,10 @@ const ErrorController = inject('storeAppOptions','storeDocumentInfo')(({storeApp
config.msg = t('Error.errorEditProtectedRange');
break;
case Asc.c_oAscError.ID.CopyDisabled:
config.msg = t('Error.errorCopyDisabled');
break;
default:
config.msg = _t.errorDefaultMessage.replace('%1', id);
break;

View File

@ -250,6 +250,7 @@ export class storeAppOptions {
this.canLiveView = !!params.asc_getLiveViewerSupport() && (this.config.mode === 'view') && !(type && typeof type[1] === 'string') && isSupportEditFeature;
this.isAnonymousSupport = !!Common.EditorApi.get().asc_isAnonymousSupport();
this.canCopy = permissions.copy !== false;
}
setCanViewReview (value) {

View File

@ -1360,7 +1360,7 @@ define([], function () {
if (me.api) {
var res = (item.value == 'cut') ? me.api.Cut() : ((item.value == 'copy') ? me.api.Copy() : me.api.Paste(item.value == 'paste-before'));
if (!res) {
if (!Common.localStorage.getBool("pdfe-hide-copywarning")) {
if (!Common.localStorage.getBool("pdfe-hide-copywarning") && (item.value === 'paste' || me.mode.canCopy)) {
(new Common.Views.CopyWarningDialog({
handler: function(dontshow) {
if (dontshow) Common.localStorage.setItem("pdfe-hide-copywarning", 1);

View File

@ -1036,6 +1036,9 @@ define([
me.hidePreloader();
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
if (!me.appOptions.canCopy)
Common.UI.TooltipManager.showTip({ step: 'copyDisabled', text: me.errorCopyDisabled, target: '#toolbar', maxwidth: 350, automove: true, noHighlight: true, noArrow: true, showButton: false});
Common.Utils.InternalSettings.set("pdfe-settings-livecomment", true);
Common.Utils.InternalSettings.set("pdfe-settings-resolvedcomment", false);
@ -1382,6 +1385,7 @@ define([
this.appOptions.canDownload = this.permissions.download !== false;
this.appOptions.showSaveButton = this.appOptions.isEdit && !this.appOptions.isPDFFill && (this.appOptions.canSaveToFile || this.appOptions.canDownload);
this.appOptions.canSuggest = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.suggestFeature===false);
this.appOptions.canCopy = this.permissions.copy !== false;
this.appOptions.compactHeader = this.appOptions.customization && (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compactHeader;
this.appOptions.twoLevelHeader = this.appOptions.isEdit || this.appOptions.isRestrictedEdit; // when compactHeader=true some buttons move to toolbar
@ -1882,6 +1886,11 @@ define([
config.msg = this.errorPDFFormsLocked;
break;
case Asc.c_oAscError.ID.CopyDisabled:
config.maxwidth = 450;
config.msg = this.errorCopyDisabled;
break;
default:
config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id);
if (typeof id == 'string')

View File

@ -925,7 +925,7 @@ define([
if (me.api) {
var res = (type === 'cut') ? me.api.Cut() : ((type === 'copy') ? me.api.Copy() : me.api.Paste());
if (!res) {
if (!Common.localStorage.getBool("pdfe-hide-copywarning")) {
if (!Common.localStorage.getBool("pdfe-hide-copywarning") && (type === 'paste' || me.toolbar.mode.canCopy)) {
(new Common.Views.CopyWarningDialog({
handler: function(dontshow) {
if (dontshow) Common.localStorage.setItem("pdfe-hide-copywarning", 1);

View File

@ -1592,6 +1592,7 @@
"PDFE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
"PDFE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
"PDFE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"PDFE.Controllers.Main.errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard.",
"PDFE.Controllers.Navigation.txtBeginning": "Beginning of document",
"PDFE.Controllers.Navigation.txtGotoBeginning": "Go to the beginning of the document",
"PDFE.Controllers.Print.textMarginsLast": "Last custom",

View File

@ -742,6 +742,10 @@ PE.ApplicationController = new(function(){
message = me.errorEditingDownloadas;
break;
case Asc.c_oAscError.ID.CopyDisabled:
message= me.errorCopyDisabled;
break;
default:
// message = me.errorDefaultMessage.replace('%1', id);
// break;
@ -936,6 +940,7 @@ PE.ApplicationController = new(function(){
txtPressLink: 'Click the link to open it',
txtOpenWarning: 'Clicking this link can be harmful to your device and data.To protect you computer, click only those hyperlinks from trusted sources. This location may be unsafe:<br>%1<br>Are you sure you want to continue?',
txtYes:'Yes',
txtNo: 'No'
txtNo: 'No',
errorCopyDisabled: 'For security reasons, the contents of this document cannot be copied to the clipboard.'
}
})();

View File

@ -48,6 +48,7 @@
"PE.ApplicationController.waitText": "Please, wait...",
"PE.ApplicationController.warnLicenseBefore": "License not active. Please contact your administrator.",
"PE.ApplicationController.warnLicenseExp": "Your license has expired. Please update your license and refresh the page.",
"PE.ApplicationController.errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard.",
"PE.ApplicationView.txtDownload": "Download",
"PE.ApplicationView.txtEmbed": "Embed",
"PE.ApplicationView.txtFileLocation": "Open file location",

View File

@ -1569,7 +1569,7 @@ define([], function () {
if (me.api) {
var res = (item.value == 'cut') ? me.api.Cut() : ((item.value == 'copy') ? me.api.Copy() : me.api.Paste());
if (!res) {
if (!Common.localStorage.getBool("pe-hide-copywarning")) {
if (!Common.localStorage.getBool("pe-hide-copywarning") && (item.value === 'paste' || me.mode.canCopy)) {
(new Common.Views.CopyWarningDialog({
handler: function(dontshow) {
if (dontshow) Common.localStorage.setItem("pe-hide-copywarning", 1);

View File

@ -912,6 +912,9 @@ define([
me.hidePreloader();
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
if (!me.appOptions.canCopy)
Common.UI.TooltipManager.showTip({ step: 'copyDisabled', text: me.errorCopyDisabled, target: '#toolbar', maxwidth: 350, automove: true, noHighlight: true, noArrow: true, showButton: false});
Common.Utils.InternalSettings.set("pe-settings-datetime-default", Common.localStorage.getItem("pe-settings-datetime-default"));
value = Common.localStorage.getItem("pe-settings-zoom");
@ -1383,6 +1386,7 @@ define([
this.appOptions.canSaveToFile = this.appOptions.isEdit || this.appOptions.isRestrictedEdit;
this.appOptions.showSaveButton = this.appOptions.isEdit;
this.appOptions.canSuggest = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.suggestFeature===false);
this.appOptions.canCopy = this.permissions.copy !== false;
this.appOptions.compactHeader = this.appOptions.customization && (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compactHeader;
this.appOptions.twoLevelHeader = this.appOptions.isEdit; // when compactHeader=true some buttons move to toolbar
@ -1838,6 +1842,11 @@ define([
config.msg = this.errorSaveWatermark;
break;
case Asc.c_oAscError.ID.CopyDisabled:
config.maxwidth = 450;
config.msg = this.errorCopyDisabled;
break;
default:
config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id);
if (typeof id == 'string')

View File

@ -1242,7 +1242,7 @@ define([
if (me.api) {
var res = (type === 'cut') ? me.api.Cut() : ((type === 'copy') ? me.api.Copy() : me.api.Paste());
if (!res) {
if (!Common.localStorage.getBool("pe-hide-copywarning")) {
if (!Common.localStorage.getBool("pe-hide-copywarning") && (type === 'paste' || me.toolbar.mode.canCopy)) {
(new Common.Views.CopyWarningDialog({
handler: function(dontshow) {
if (dontshow) Common.localStorage.setItem("pe-hide-copywarning", 1);

View File

@ -1761,6 +1761,7 @@
"PE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
"PE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
"PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"PE.Controllers.Main.errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard.",
"PE.Controllers.Print.txtPrintRangeInvalid": "Invalid print range",
"PE.Controllers.Print.txtPrintRangeSingleRange": "Enter either a single slide number or a single slide range (for example, 5-12). Or you can Print to PDF.",
"PE.Controllers.Search.notcriticalErrorTitle": "Warning",

View File

@ -240,7 +240,8 @@
"unknownErrorText": "Unknown error.",
"uploadImageExtMessage": "Unknown image format.",
"uploadImageFileCountMessage": "No images uploaded.",
"uploadImageSizeMessage": "The image is too big. The maximum size is 25 MB."
"uploadImageSizeMessage": "The image is too big. The maximum size is 25 MB.",
"errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard."
},
"LongActions": {
"applyChangesTextText": "Loading data...",

View File

@ -14,6 +14,7 @@ import EditorUIController from '../lib/patch';
canComments: stores.storeAppOptions.canComments,
canViewComments: stores.storeAppOptions.canViewComments,
canCoAuthoring: stores.storeAppOptions.canCoAuthoring,
canCopy: stores.storeAppOptions.canCopy,
users: stores.users,
isDisconnected: stores.users.isDisconnected,
objects: stores.storeFocusObjects.settings,
@ -78,12 +79,12 @@ class ContextMenu extends ContextMenuController {
const api = Common.EditorApi.get();
switch (action) {
case 'cut':
if ( !LocalStorage.getBool("pe-hide-copy-cut-paste-warning")) {
if ( !LocalStorage.getBool("pe-hide-copy-cut-paste-warning") && this.props.canCopy) {
this.showCopyCutPasteModal();
}
break;
case 'copy':
if (!api.Copy() && !LocalStorage.getBool("pe-hide-copy-cut-paste-warning")) {
if (!api.Copy() && !LocalStorage.getBool("pe-hide-copy-cut-paste-warning") && this.props.canCopy) {
this.showCopyCutPasteModal();
}
break;

View File

@ -211,6 +211,10 @@ const ErrorController = inject('storeAppOptions','storePresentationInfo')(({stor
config.msg = t('Error.errorSaveWatermark');
break;
case Asc.c_oAscError.ID.CopyDisabled:
config.msg = t('Error.errorCopyDisabled');
break;
default:
config.msg = _t.errorDefaultMessage.replace('%1', id);
break;

View File

@ -161,5 +161,6 @@ export class storeAppOptions {
this.canLiveView = !!params.asc_getLiveViewerSupport() && (this.config.mode === 'view') && isSupportEditFeature;
this.isAnonymousSupport = !!Common.EditorApi.get().asc_isAnonymousSupport();
this.canCopy = permissions.copy !== false;
}
}

View File

@ -787,6 +787,10 @@ SSE.ApplicationController = new(function(){
message = me.errorEditingDownloadas;
break;
case Asc.c_oAscError.ID.CopyDisabled:
message= me.errorCopyDisabled;
break;
default:
// message = me.errorDefaultMessage.replace('%1', id);
// break;
@ -1026,6 +1030,7 @@ SSE.ApplicationController = new(function(){
txtPressLink: 'Click the link to open it',
txtOpenWarning: 'Clicking this link can be harmful to your device and data.To protect you computer, click only those hyperlinks from trusted sources. This location may be unsafe:<br>%1<br>Are you sure you want to continue?',
txtYes:'Yes',
txtNo: 'No'
txtNo: 'No',
errorCopyDisabled: 'For security reasons, the contents of this document cannot be copied to the clipboard.'
}
})();

View File

@ -48,6 +48,7 @@
"SSE.ApplicationController.waitText": "Please, wait...",
"SSE.ApplicationController.warnLicenseBefore": "License not active. Please contact your administrator.",
"SSE.ApplicationController.warnLicenseExp": "Your license has expired. Please update your license and refresh the page.",
"SSE.ApplicationController.errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard.",
"SSE.ApplicationView.txtDownload": "Download",
"SSE.ApplicationView.txtEmbed": "Embed",
"SSE.ApplicationView.txtFileLocation": "Open file location",

View File

@ -306,7 +306,7 @@ define([], function () {
var res = (item.value == 'cut') ? me.api.asc_Cut() : ((item.value == 'copy') ? me.api.asc_Copy() : me.api.asc_Paste());
if (!res) {
var value = Common.localStorage.getItem("sse-hide-copywarning");
if (!(value && parseInt(value) == 1)) {
if (!(value && parseInt(value) == 1) && (item.value === 'paste' || me.permissions.canCopy)) {
(new Common.Views.CopyWarningDialog({
handler: function(dontshow) {
if (dontshow) Common.localStorage.setItem("sse-hide-copywarning", 1);

View File

@ -985,6 +985,8 @@ define([
Common.UI.TooltipManager.showTip({ step: 'openCsv', text: me.warnOpenCsv, target: '#toolbar', maxwidth: 350, automove: true, noHighlight: true, noArrow: true, showButton: false});
if (me.appOptions.isEdit && !me.appOptions.canModifyFilter)
Common.UI.TooltipManager.showTip({ step: 'cantModifyFilter', text: me.warnModifyFilter, target: '#toolbar', maxwidth: 400, showButton: false, automove: true, noHighlight: true, noArrow: true});
if (!me.appOptions.canCopy)
Common.UI.TooltipManager.showTip({ step: 'copyDisabled', text: me.errorCopyDisabled, target: '#toolbar', maxwidth: 350, automove: true, noHighlight: true, noArrow: true, showButton: false});
value = (this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram || this.appOptions.isEditOle) ? 100 : Common.localStorage.getItem("sse-settings-zoom");
Common.Utils.InternalSettings.set("sse-settings-zoom", value);
@ -1493,6 +1495,7 @@ define([
this.appOptions.canSaveToFile = this.appOptions.isEdit || this.appOptions.isRestrictedEdit;
this.appOptions.showSaveButton = this.appOptions.isEdit;
this.appOptions.canSuggest = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.suggestFeature===false);
this.appOptions.canCopy = this.permissions.copy !== false;
this.appOptions.compactHeader = this.appOptions.customization && (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compactHeader;
this.appOptions.twoLevelHeader = this.appOptions.isEdit; // when compactHeader=true some buttons move to toolbar
@ -2275,6 +2278,11 @@ define([
config.maxwidth = 600;
break;
case Asc.c_oAscError.ID.CopyDisabled:
config.maxwidth = 450;
config.msg = this.errorCopyDisabled;
break;
default:
config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id);
if (typeof id == 'string')

View File

@ -650,7 +650,7 @@ define([
var res = (type === 'cut') ? me.api.asc_Cut() : ((type === 'copy') ? me.api.asc_Copy() : me.api.asc_Paste());
if (!res) {
var value = Common.localStorage.getItem("sse-hide-copywarning");
if (!(value && parseInt(value) == 1)) {
if (!(value && parseInt(value) == 1) && (type === 'paste' || me.toolbar.mode.canCopy)) {
(new Common.Views.CopyWarningDialog({
handler: function(dontshow) {
if (dontshow) Common.localStorage.setItem("sse-hide-copywarning", 1);

View File

@ -1987,6 +1987,7 @@
"SSE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
"SSE.Controllers.Main.warnOpenCsv": "The CSV format does not support saving a multi-sheet file or any elements except text.<br>Only the active sheet will be saved.",
"SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"SSE.Controllers.Main.errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard.",
"SSE.Controllers.PivotTable.strSheet": "Sheet",
"SSE.Controllers.PivotTable.txtCalculatedItemInPageField": "The item cannot be added or modified. PivotTable report has this field in Filters.",
"SSE.Controllers.PivotTable.txtCalculatedItemWarningDefault": "No actions with calculated items are allowed for this active cell.",

View File

@ -379,7 +379,8 @@
"uploadDocSizeMessage": "Maximum document size limit exceeded.",
"uploadImageExtMessage": "Unknown image format.",
"uploadImageFileCountMessage": "No images uploaded.",
"uploadImageSizeMessage": "The image is too big. The maximum size is 25 MB."
"uploadImageSizeMessage": "The image is too big. The maximum size is 25 MB.",
"errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard."
},
"LongActions": {
"advDRMPassword": "Password",

View File

@ -12,6 +12,7 @@ import EditorUIController from '../lib/patch';
canComments: stores.storeAppOptions.canComments,
canViewComments: stores.storeAppOptions.canViewComments,
canCoAuthoring: stores.storeAppOptions.canCoAuthoring,
canCopy: stores.storeAppOptions.canCopy,
isRestrictedEdit: stores.storeAppOptions.isRestrictedEdit,
users: stores.users,
isDisconnected: stores.users.isDisconnected,
@ -107,12 +108,12 @@ class ContextMenu extends ContextMenuController {
switch (action) {
case 'cut':
if (!LocalStorage.getBool("sse-hide-copy-cut-paste-warning")) {
if (!LocalStorage.getBool("sse-hide-copy-cut-paste-warning") && this.props.canCopy) {
this.showCopyCutPasteModal();
}
break;
case 'copy':
if (!api.asc_Copy() && !LocalStorage.getBool("sse-hide-copy-cut-paste-warning")) {
if (!api.asc_Copy() && !LocalStorage.getBool("sse-hide-copy-cut-paste-warning") && this.props.canCopy) {
this.showCopyCutPasteModal();
}
break;

View File

@ -511,6 +511,10 @@ const ErrorController = inject('storeAppOptions','storeSpreadsheetInfo')(({store
config.msg = t('Error.errorMacroUnavailableWarning').replace('%1', errData ? "'" + errData + "'" : '');
break;
case Asc.c_oAscError.ID.CopyDisabled:
config.msg = t('Error.errorCopyDisabled');
break;
default:
config.msg = _t.errorDefaultMessage.replace('%1', id);
break;

View File

@ -163,5 +163,6 @@ export class storeAppOptions {
this.canLiveView = !!params.asc_getLiveViewerSupport() && (this.config.mode === 'view') && isSupportEditFeature;
this.isAnonymousSupport = !!Common.EditorApi.get().asc_isAnonymousSupport();
this.canCopy = permissions.copy !== false;
}
}

View File

@ -783,6 +783,10 @@ VE.ApplicationController = new(function(){
message = me.errorEditingDownloadas;
break;
case Asc.c_oAscError.ID.CopyDisabled:
message= me.errorCopyDisabled;
break;
default:
// message = me.errorDefaultMessage.replace('%1', id);
// break;
@ -975,6 +979,7 @@ VE.ApplicationController = new(function(){
txtPage: 'Page',
txtOpenWarning: 'Clicking this link can be harmful to your device and data.To protect you computer, click only those hyperlinks from trusted sources. This location may be unsafe:<br>%1<br>Are you sure you want to continue?',
txtYes:'Yes',
txtNo: 'No'
txtNo: 'No',
errorCopyDisabled: 'For security reasons, the contents of this document cannot be copied to the clipboard.'
}
})();

View File

@ -49,6 +49,7 @@
"VE.ApplicationController.waitText": "Please, wait...",
"VE.ApplicationController.warnLicenseBefore": "License not active. Please contact your administrator.",
"VE.ApplicationController.warnLicenseExp": "Your license has expired. Please update your license and refresh the page.",
"VE.ApplicationController.errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard.",
"VE.ApplicationView.txtDownload": "Download",
"VE.ApplicationView.txtEmbed": "Embed",
"VE.ApplicationView.txtFileLocation": "Open file location",

View File

@ -531,7 +531,7 @@ define([
if (me.api) {
var res = (item.value == 'cut') ? me.api.Cut() : ((item.value == 'copy') ? me.api.Copy() : me.api.Paste());
if (!res) {
if (!Common.localStorage.getBool("ve-hide-copywarning")) {
if (!Common.localStorage.getBool("ve-hide-copywarning") && (item.value === 'paste' || me.mode.canCopy)) {
(new Common.Views.CopyWarningDialog({
handler: function(dontshow) {
if (dontshow) Common.localStorage.setItem("ve-hide-copywarning", 1);

View File

@ -877,6 +877,9 @@ define([
me.hidePreloader();
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
// if (!me.appOptions.canCopy) // Show this warning when copy button is added to the toolbar
// Common.UI.TooltipManager.showTip({ step: 'copyDisabled', text: me.errorCopyDisabled, target: '#toolbar', maxwidth: 350, automove: true, noHighlight: true, noArrow: true, showButton: false});
if (zf == -1) {
this.api.zoomFitToPage();
} else if (zf == -2) {
@ -1180,6 +1183,7 @@ define([
this.appOptions.canSaveToFile = this.appOptions.isEdit || this.appOptions.isRestrictedEdit;
this.appOptions.showSaveButton = this.appOptions.isEdit;
this.appOptions.canSuggest = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.suggestFeature===false);
this.appOptions.canCopy = this.permissions.copy !== false;
this.appOptions.compactHeader = this.appOptions.customization && (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compactHeader;
this.appOptions.twoLevelHeader = this.appOptions.isEdit; // when compactHeader=true some buttons move to toolbar
@ -1511,6 +1515,11 @@ define([
config.msg = this.errorInconsistentExt;
break;
case Asc.c_oAscError.ID.CopyDisabled:
config.maxwidth = 450;
config.msg = this.errorCopyDisabled;
break;
default:
config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id);
if (typeof id == 'string')

View File

@ -322,6 +322,7 @@
"VE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
"VE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
"VE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"VE.Controllers.Main.errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard.",
"VE.Controllers.Search.notcriticalErrorTitle": "Warning",
"VE.Controllers.Search.textNoTextFound": "The data you have been searching for could not be found. Please adjust your search options.",
"VE.Controllers.Search.textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",

View File

@ -120,7 +120,8 @@
"unknownErrorText": "Unknown error.",
"uploadImageExtMessage": "Unknown image format.",
"uploadImageFileCountMessage": "No images uploaded.",
"uploadImageSizeMessage": "The image is too big. The maximum size is 25 MB."
"uploadImageSizeMessage": "The image is too big. The maximum size is 25 MB.",
"errorCopyDisabled": "For security reasons, the contents of this document cannot be copied to the clipboard."
},
"LongActions": {
"applyChangesTextText": "Loading data...",

View File

@ -199,6 +199,10 @@ const ErrorController = inject('storeAppOptions','storeVisioInfo')(({storeAppOpt
config.msg = t('Error.errorSaveWatermark');
break;
case Asc.c_oAscError.ID.CopyDisabled:
config.msg = t('Error.errorCopyDisabled');
break;
default:
config.msg = _t.errorDefaultMessage.replace('%1', id);
break;

View File

@ -151,5 +151,6 @@ export class storeAppOptions {
this.canLiveView = !!params.asc_getLiveViewerSupport() && (this.config.mode === 'view') && isSupportEditFeature;
this.isAnonymousSupport = !!Common.EditorApi.get().asc_isAnonymousSupport();
this.canCopy = permissions.copy !== false;
}
}