Added groups and restricted access.

This commit is contained in:
sarah committed 2026-09-21 06:52:31 +02:00
1 parent 8aa223bc7b
commit 9a5b9530a3
17 files changed
+1406 -66

No files matched your search

+52
View File
@@ -81,6 +81,58 @@ export function GetAvatarUrl(Username) {
return `${ApiBase}/profile/avatar?${Params}`;
}
export function UpdateUsername(NewUsername) {
return FetchJson("/profile/username", { method: "PUT", ...JsonBody({ NewUsername }) });
}
export function ChangePassword(CurrentPassword, NewPassword) {
return FetchJson("/profile/password", {
method: "PUT",
...JsonBody({ CurrentPassword, NewPassword }),
});
}
// --- Groups ---------------------------------------------------------------
export function FetchGroups() {
return FetchJson("/groups");
}
export function CreateGroupApi(Name) {
return FetchJson("/groups", { method: "POST", ...JsonBody({ Name }) });
}
export function DeleteGroupApi(Name) {
const Params = new URLSearchParams({ Name });
return FetchJson(`/groups?${Params}`, { method: "DELETE" });
}
export function SetGroupMembersApi(Name, Members) {
const Params = new URLSearchParams({ Name });
return FetchJson(`/groups/members?${Params}`, { method: "PUT", ...JsonBody({ Members }) });
}
// --- Locked files/directories -----------------------------------------
export function FetchLocks() {
return FetchJson("/locks");
}
export function FetchLock(RootName, RelativePath) {
const Params = new URLSearchParams({ Root: RootName, Path: RelativePath });
return FetchJson(`/lock?${Params}`);
}
export function SetLock(RootName, RelativePath, Users, Groups) {
const Params = new URLSearchParams({ Root: RootName, Path: RelativePath });
return FetchJson(`/lock?${Params}`, { method: "PUT", ...JsonBody({ Users, Groups }) });
}
export function RemoveLock(RootName, RelativePath) {
const Params = new URLSearchParams({ Root: RootName, Path: RelativePath });
return FetchJson(`/lock?${Params}`, { method: "DELETE" });
}
// --- Files --------------------------------------------------------------
export function FetchRoots() {