Skip to content
File

Blob: src/worker/webdav/access.ts

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