π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix(nc-gui): restrict drop operation if user dont have permission
Ramesh Mane769bcbde5982
diff --git a/packages/nc-gui/components/smartsheet/grid/canvas/cells/index.ts b/packages/nc-gui/components/smartsheet/grid/canvas/cells/index.tsindex 7a561332a9..e37c0630ab 100644--- a/packages/nc-gui/components/smartsheet/grid/canvas/cells/index.ts+++ b/packages/nc-gui/components/smartsheet/grid/canvas/cells/index.ts@@ -332,6 +332,7 @@ export function useGridCellHandler(params: {isRootCell &&column.uidt === UITypes.Attachment &&!column.readonly &&+ params.hasEditPermission.value &¶ms.attachmentCellDropOver.value &&comparePath(path, params.attachmentCellDropOver.value.path ?? []) &¶ms.attachmentCellDropOver.value.columnId === column.id &&diff --git a/packages/nc-gui/components/smartsheet/grid/canvas/composables/useCopyPaste.ts b/packages/nc-gui/components/smartsheet/grid/canvas/composables/useCopyPaste.tsindex ec11c469dc..19d70ab290 100644--- a/packages/nc-gui/components/smartsheet/grid/canvas/composables/useCopyPaste.ts+++ b/packages/nc-gui/components/smartsheet/grid/canvas/composables/useCopyPaste.ts@@ -1132,6 +1132,8 @@ export function useCopyPaste({}const handleAttachmentCellDrop = async (files: File[], attachmentCellDropOver: AttachmentCellDropOverType) => {+ if (isSqlView.value || isPublic.value || !hasEditPermission.value) return false+if (!meta.value?.id) returnconst dataCache = getDataCache(attachmentCellDropOver.path)diff --git a/packages/nc-gui/components/smartsheet/grid/canvas/index.vue b/packages/nc-gui/components/smartsheet/grid/canvas/index.vueindex 52a608ad52..c34e89fcc2 100644--- a/packages/nc-gui/components/smartsheet/grid/canvas/index.vue+++ b/packages/nc-gui/components/smartsheet/grid/canvas/index.vue@@ -2625,7 +2625,7 @@ const resetAttachmentCellDropOver = () => {}const onDrop = (files: File[] | null) => {- if (!attachmentCellDropOver.value || !files?.length) {+ if (!attachmentCellDropOver.value || !files?.length || !isDataEditAllowed.value) {return}@@ -2661,6 +2661,8 @@ const onDrop = (files: File[] | null) => {}const onOver = (_files: File[] | null, e: DragEvent) => {+ if (!isDataEditAllowed.value) return+const rect = canvasRef.value?.getBoundingClientRect()if (!rect) return