From 5842448f1e2aa7185d96ad4d90b18771f95367e5 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Wed, 9 Nov 2022 11:50:49 +0200 Subject: [PATCH] user --- src/server/structures/User.js | 22 ++++++++++++++++++++++ src/server/structures/index.js | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 src/server/structures/User.js create mode 100644 src/server/structures/index.js diff --git a/src/server/structures/User.js b/src/server/structures/User.js new file mode 100644 index 0000000..86a22a0 --- /dev/null +++ b/src/server/structures/User.js @@ -0,0 +1,22 @@ +class User { + + static defaultPermissions = {}; + + constructor (db, data) { + + this.id = data._id; + this._db = db; + + this.permissions = { ...User.defaultPermissions, ...data.permissions }; + + } + + hasPermission (perm) { + + return this.permissions[perm]; + + } + +} + +module.exports = User; \ No newline at end of file diff --git a/src/server/structures/index.js b/src/server/structures/index.js new file mode 100644 index 0000000..32aeadf --- /dev/null +++ b/src/server/structures/index.js @@ -0,0 +1,3 @@ +module.exports = { + User: require('./User') +}; \ No newline at end of file