From d8f89a0be6b20e915bbf4fa58338609f4c3a2e48 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 9 Oct 2024 11:33:18 +1100 Subject: [PATCH] refactor(server/accounts): comments --- server/accounts/class.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/accounts/class.ts b/server/accounts/class.ts index fa722470..b8dfab8f 100644 --- a/server/accounts/class.ts +++ b/server/accounts/class.ts @@ -138,6 +138,9 @@ export class OxAccount extends ClassInterface { return charId && UpdateAccountAccess(this.accountId, charId, role); } + /** + * Checks if a player's active character has permission to perform an action on the account. + */ async playerHasPermission(playerId: number, permission: keyof OxAccountPermissions) { const player = OxPlayer.get(playerId); @@ -147,10 +150,16 @@ export class OxAccount extends ClassInterface { return await CanPerformAction(player, this.accountId, role, permission); } + /** + * Set the account as shared, allowing permissions to be assigned to other characters. + */ async setShared() { return SetAccountType(this.accountId, 'shared'); } + /** + * Create an unpaid invoice on the account. + */ async createInvoice(data: Omit) { const invoice = { fromAccount: this.accountId,