core&ui: upgrade simplewebauthn

This commit is contained in:
undefined committed 2025-02-15 10:43:15 +08:00
1 parent 3a30cc55f9
commit 04fcd57f51
9 files changed
+20 -26

No files matched your search

+4 -10
View File
@@ -127,18 +127,12 @@ export class User {
: doc.owner === this._id || (doc.maintainer || []).includes(this._id);
}
hasPerm(...perm: bigint[]) {
for (const i in perm) {
if ((this.perm & this.scope & perm[i]) === perm[i]) return true;
}
return false;
hasPerm(...perms: bigint[]) {
return perms.some((perm) => (this.perm & this.scope & perm) === perm);
}
hasPriv(...priv: number[]) {
for (const i in priv) {
if ((this.priv & priv[i]) === priv[i]) return true;
}
return false;
hasPriv(...privs: number[]) {
return privs.some((priv) => (this.priv & priv) === priv);
}
async checkPassword(password: string) {