webserver-framework/test/PermissionManager.test.js
2023-02-07 21:15:04 +02:00

17 lines
637 B
JavaScript

/* eslint-disable no-console */
const { PermissionManager } = require('../src/util');
const { inspect } = require('node:util');
const log = (obj) => {
console.log(inspect(obj, { depth: 10 }));
};
// PermissionManager.ensurePermission('administrator');
PermissionManager.ensurePermission('administrator:removeuser:force:bruh:moment:broo');
PermissionManager.ensurePermission('developer:toggledebug');
PermissionManager.ensurePermission('developer');
// log(PermissionManager);
const perms = { developer: { default: 10 }, administrator: 10 };
log(PermissionManager.merge(perms, PermissionManager.DefaultPermissions));
// log(perms);