feat: very basic screenshot api

This commit is contained in:
Huskydog9988
2025-05-15 15:51:35 -04:00
parent 831b20d737
commit a89c657fe1
9 changed files with 126 additions and 5 deletions

View File

@ -22,6 +22,10 @@ export const userACLDescriptions: ObjectFromList<typeof userACLs> = {
"notifications:listen": "Connect to a websocket to recieve notifications.",
"notifications:delete": "Delete this account's notifications.",
"screenshots:new": "Create screenshots for this account",
"screenshots:read": "Read all screenshots for this account",
"screenshots:delete": "Delete a screenshot for this account",
"collections:new": "Create collections for this account.",
"collections:read": "Fetch all collections (including library).",
"collections:delete": "Delete a collection for this account.",

View File

@ -17,6 +17,10 @@ export const userACLs = [
"notifications:listen",
"notifications:delete",
"screenshots:new",
"screenshots:read",
"screenshots:delete",
"collections:new",
"collections:read",
"collections:delete",
@ -83,6 +87,12 @@ class ACLManager {
return token;
}
/**
* Get userId and require one of the specified acls
* @param request
* @param acls
* @returns
*/
async getUserIdACL(request: MinimumRequestObject | undefined, acls: UserACL) {
if (!request)
throw new Error("Native web requests not available - weird deployment?");