From 6f2a8827b959fd4bdf16bba31ef104c93b24f0b9 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Thu, 14 Apr 2022 12:59:26 +0200 Subject: [PATCH 1/2] fix readonly flag fo texteditor --- packages/web-app-text-editor/src/App.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/web-app-text-editor/src/App.vue b/packages/web-app-text-editor/src/App.vue index 8b275867def..9d5eae5a16e 100644 --- a/packages/web-app-text-editor/src/App.vue +++ b/packages/web-app-text-editor/src/App.vue @@ -91,8 +91,9 @@ export default { unref(defaults) .getFileInfo(filePath, [DavProperty.Permissions]) .then((response) => { - isReadOnly.value = - response.fileInfo[DavProperty.Permissions].indexOf(DavPermission.Updateable) === -1 + isReadOnly.value = ![DavPermission.Updateable, DavPermission.FileUpdateable].includes( + response.fileInfo[DavProperty.Permissions] + ) }) return yield unref(defaults) From ce32bf543669539bffbe89d9b8d4ad67f351194b Mon Sep 17 00:00:00 2001 From: Florian Schade Date: Thu, 14 Apr 2022 13:53:22 +0200 Subject: [PATCH 2/2] swtich from DavPermission exect match to contains match --- packages/web-app-text-editor/src/App.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web-app-text-editor/src/App.vue b/packages/web-app-text-editor/src/App.vue index 9d5eae5a16e..edfc4b6686a 100644 --- a/packages/web-app-text-editor/src/App.vue +++ b/packages/web-app-text-editor/src/App.vue @@ -91,8 +91,8 @@ export default { unref(defaults) .getFileInfo(filePath, [DavProperty.Permissions]) .then((response) => { - isReadOnly.value = ![DavPermission.Updateable, DavPermission.FileUpdateable].includes( - response.fileInfo[DavProperty.Permissions] + isReadOnly.value = ![DavPermission.Updateable, DavPermission.FileUpdateable].some( + (p) => response.fileInfo[DavProperty.Permissions].indexOf(p) > -1 ) })