UI/Sharing: Allow explicit setting of write-properties permission

This commit is contained in:
Max Berger
2026-04-11 21:51:26 +02:00
parent 11ecb8c672
commit a5780f2dc5
5 changed files with 75 additions and 10 deletions

View File

@@ -99,6 +99,18 @@ export class CollectionType {
}
}
export class Permission {
// Private Fields
static #_WRITE_PROPERTIES = "D:write-properties";
static #_SHARE_MAP = "RADICALE:share-map";
static #_SHARE_TOKEN = "RADICALE:share-token";
// Accessors for "get" functions only (no "set" functions)
static get WRITE_PROPERTIES() { return this.#_WRITE_PROPERTIES; }
static get SHARE_MAP() { return this.#_SHARE_MAP; }
static get SHARE_TOKEN() { return this.#_SHARE_TOKEN; }
}
export class Collection {
/**
@@ -123,4 +135,11 @@ export class Collection {
this.size = size;
this.permissions = permissions;
}
has_permission(/** @type {string} */ permission) {
if (!this.permissions) {
return false;
}
return this.permissions.includes(permission);
}
}