Skip to content

Commit

Permalink
better roles config
Browse files Browse the repository at this point in the history
  • Loading branch information
bwyx committed Jun 6, 2021
1 parent 6d0ccea commit 19cda9c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/config/roles.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const roles = ['user', 'admin'];
const allRoles = {
user: [],
admin: ['getUsers', 'manageUsers'],
};

const roleRights = new Map();
roleRights.set(roles[0], []);
roleRights.set(roles[1], ['getUsers', 'manageUsers']);
const roles = Object.keys(allRoles);
const roleRights = new Map(Object.entries(allRoles));

module.exports = {
roles,
Expand Down

0 comments on commit 19cda9c

Please sign in to comment.