UI/Sharing: Allow explicit setting of write-properties permission
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user