merge default perms for users
This commit is contained in:
parent
51601e9972
commit
cf1711ead7
@ -26,7 +26,7 @@ class Users extends EventEmitter {
|
||||
const id = user.id || user;
|
||||
this.emit('debug', `User perms query for ${id}`);
|
||||
const userPartial = await this.database.findOne(this.collection, { id });
|
||||
user = { ...user, ...userPartial };
|
||||
user = { ...this.defaultPermissions, ...userPartial, ...user };
|
||||
user.tag = `${user.username}#${user.discriminator}`;
|
||||
this.emit('debug', `Result for ${id}: ${JSON.stringify(userPartial)}`);
|
||||
if (userPartial) return user;
|
||||
@ -44,6 +44,13 @@ class Users extends EventEmitter {
|
||||
|
||||
}
|
||||
|
||||
get defaultPermissions() {
|
||||
return {
|
||||
admin: false,
|
||||
upload: false
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Users;
|
Loading…
Reference in New Issue
Block a user