diff --git a/server/src/client/Users.js b/server/src/client/Users.js index fda774c..6006dc2 100644 --- a/server/src/client/Users.js +++ b/server/src/client/Users.js @@ -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; \ No newline at end of file