File
Blob: src/worker/webdav/access.ts
| 1 | import { hasDavScope } from "@/worker/auth/scopes"; |
| 2 | import type { DavScope } from "@/worker/db/types"; |
| 3 | |
| 4 | export function hasFilesScope(authScopes: DavScope[], scope: "dav:files:read" | "dav:files:write"): boolean { |
| 5 | return hasDavScope(authScopes, scope); |
| 6 | } |
| 7 | |
| 8 | export function requiresFileWrite(method: string): boolean { |
| 9 | return !["OPTIONS", "PROPFIND", "GET", "HEAD"].includes(method); |
| 10 | } |