使用 BigInt 进行权限管理

This commit is contained in:
undefined committed 2020-07-14 22:03:54 +08:00
1 parent eaed0e84f5
commit 8aef05a375
17 files changed
+252 -197

No files matched your search

+19 -3
View File
@@ -15,6 +15,22 @@ export interface Setting {
}
export interface Udoc extends Dictionary<any> {
_id: number,
mail: string,
mailLower: string,
uname: string,
unameLower: string,
salt: string,
hash: string,
hashType: string,
priv: number,
regat: Date,
loginat: Date,
regip: string,
loginip: string,
}
export interface User extends Dictionary<any> {
udoc: () => any,
dudoc: () => any,
_id: number,
@@ -26,16 +42,16 @@ export interface Udoc extends Dictionary<any> {
priv: number,
regat: Date,
loginat: Date,
perm: string,
perm: bigint,
role: string,
regip: () => string,
loginip: () => string,
hasPerm: (perm: string) => boolean,
hasPerm: (perm: bigint) => boolean,
hasPriv: (priv: number) => boolean,
checkPassword: (password: string) => void,
}
export type Udict = NumericDictionary<Udoc>;
export type Udict = NumericDictionary<User>;
export interface Pdoc {
_id: ObjectID,