This project demonstrates how to implement Role-Based Access Control (RBAC) using JWT authentication in an Express.js application. The app will handle authentication and authorization based on user roles: Admin
, Editor
, and Viewer
. Each role has different levels of access to various routes.
If you haven't installed Git on your PC, download and install it from the official Git website.
Set your global username and email:
$ git config --list --show-origin
$ git config --global user.name "Your Name"
Here’s how you can use the KEYS
command in Redis Commander:
- Command:
KEYS pattern
- Function: The
KEYS
command is used to find all keys matching a specific pattern. This can be especially helpful when you want to locate keys with a common prefix, suffix, or specific pattern in their names. In Redis Commander, you can use this command to search for keys that match the pattern you specify. - Example:
- Pattern:
example:*
- Pattern:
- Command:
KEYS example:*
- Get the latest version of the PostgreSQL image.
$ sudo docker pull postgres
- Run a PostgreSQL container with the name my-postgres, and run the container in the background.
$ sudo docker run --name my-postgres \ -e POSTGRES_USER=postgres \ -e POSTGRES_PASSWORD=postgres \
NewerOlder