Skip to content

Commit

Permalink
refactor(server/accounts): comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Oct 9, 2024
1 parent 53dc748 commit d8f89a0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/accounts/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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<OxCreateInvoice, 'fromAccount'>) {
const invoice = {
fromAccount: this.accountId,
Expand Down

0 comments on commit d8f89a0

Please sign in to comment.