Monday, 15 June 2020

User access for different modules based on user role

I am setting up an application which has multiple user roles accessing different components in the client-side. Being a beginner in node, I would like to make the calls to the db only if the user has access to a particular module. Say, the user roles I've created are admin, distributors, team leads and team member. For example, the team member shouldn't have access to the distributor's list. I got a suggestion from a fellow developer to store user id and the access as key-value pairs in Redis ( _id: 123, distributorModule: true) and fetch it every time prior to a call to the DB is made.Is there a better way to do this, please suggest

Submitted June 15, 2020 at 03:23PM by ScrewupPro

No comments:

Post a Comment