mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: confusing behavior on permissions
This commit is contained in:
parent
630be18ae9
commit
16b9ee3bc5
@ -25,13 +25,21 @@ export class Permissions implements BitField<bigint> {
|
||||
/** Stores all entity permissions */
|
||||
bitfield: bigint;
|
||||
|
||||
/** Wheter to grant all other permissions to the administrator */
|
||||
/**
|
||||
* Wheter to grant all other permissions to the administrator
|
||||
* **Not to get confused with Permissions#admin**
|
||||
*/
|
||||
__admin__ = true;
|
||||
|
||||
constructor(bitfield: PermissionResolvable) {
|
||||
this.bitfield = Permissions.resolve(bitfield);
|
||||
}
|
||||
|
||||
/** Wheter the bitfield has the administrator flag */
|
||||
get admin(): boolean {
|
||||
return (this.bitfield & BigInt(Permissions.Flags.ADMINISTRATOR)) === this.bitfield;
|
||||
}
|
||||
|
||||
get array(): PermissionString[] {
|
||||
// unsafe cast, do not edit
|
||||
const permissions = Object.keys(Permissions.Flags) as PermissionString[];
|
||||
|
Loading…
x
Reference in New Issue
Block a user