Skip to content

Commit aad5729

Browse files
committed
fix: use files permission enum
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
1 parent 3e69ab2 commit aad5729

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/playwright/support/utils/sharing.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55

66
import type { APIRequestContext } from '@playwright/test'
77

8-
/** Nextcloud share permission bits (see OCS Share API). */
8+
// we cannot import the enum directly from the files app.
9+
// It references the window object and causes errors when imported in a node context,
10+
// so we re-declare the relevant values here. The type assertion ensures we stay in sync.
911
export const SharePermission = {
1012
READ: 1,
1113
UPDATE: 2,
1214
CREATE: 4,
1315
DELETE: 8,
1416
SHARE: 16,
15-
} as const
17+
} as const satisfies Partial<typeof import('@nextcloud/files').Permission>
1618

1719
/** All permissions a user share can grant. */
1820
export const ALL_PERMISSIONS = SharePermission.READ

0 commit comments

Comments
 (0)