---
title: "Discussion on \"Role-Based Access Control ( RBAC) for NoSQL DB in Nodejs\" | Hashnode"
description: "Discussion on \"Role-Based Access Control ( RBAC) for NoSQL DB in Nodejs\". Many RBAC (Role-Based Access Control) implementations differ, but the basics are widely adopted since it simulates real-life role (job) assignments.  - Onur Yıldırım.\n\nRole-based access control (RBAC) is a method of modifying access and privileges ba..."
url: "https://hashnode.com/posts/role-based-access-control-rbac-for-nosql-db-in-nodejs/5ff2096a45519f71a3337380"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Role-Based Access Control ( RBAC) for NoSQL DB in Nodejs](https://blog.nextwebb.tech/role-based-access-control-rbac-for-nosql-db-in-nodejs?utm_source=hashnode&utm_medium=feed)

Many RBAC (Role-Based Access Control) implementations differ, but the basics are widely adopted since it simulates real-life role (job) assignments. - Onur Yıldırım. Role-based access control (RBAC) is a method of modifying access and privileges ba...

Jan 3, 2021 · 6 min read · blog.nextwebb.tech  
Read the article

-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#mongodb](https://hashnode.com/tag/mongodb)
-   [#mongoose](https://hashnode.com/tag/mongoose)
-   [#apis](https://hashnode.com/tag/apis)
-   [#databases](https://hashnode.com/tag/databases)

## Written by

[Nextwebb](https://hashnode.com/@nextwebb)

@nextwebb · Worldwide

  
[View profile](https://hashnode.com/@nextwebb)

Software engineer , Open-source contributor && Community lead :)

SWE | Avid learner | Technical director @repotecc | open-source contributor | Web enthusiast | Community lead @DscOui and developer advocate

## Responses 2

Markdown supported · ⌘↵ to post

[Bashko Ali](https://hashnode.com/@Bashkos)

[Oct 13, 2022](https://hashnode.com/posts/role-based-access-control-rbac-for-nosql-db-in-nodejs/5ff2096a45519f71a3337380/comment/634832331b098b3c50f26a0a)

Hi, thanks for helpful article. I'm really wondering how can we get the resource\_id in the middleware to get the right permissions?

[Nextwebb](https://hashnode.com/@nextwebb)

[Feb 21, 2023](https://hashnode.com/posts/role-based-access-control-rbac-for-nosql-db-in-nodejs/5ff2096a45519f71a3337380/comment/634832331b098b3c50f26a0a#reply-63f4768991a509b61ed033bd)

Thanks for reading my blog [Bashko Ali](https://hashnode.com/@Bashkos)! While this is just a boilerplate for RBAC needs. To get the resource\_id in the middleware, you can either add it to the request object or extract it from the request URL.

Adding it to the request object would involve modifying the routing code to pass the resource\_id to the middleware.

Extracting it from the request URL would involve parsing the URL and extracting the resource\_id from it. You can also improve this and share.

[Tracy Nuwagaba](https://hashnode.com/@tracycod3r)

[Jan 20, 2021](https://hashnode.com/posts/role-based-access-control-rbac-for-nosql-db-in-nodejs/5ff2096a45519f71a3337380/comment/60083c65394f022604c10dcd)

Awesome article
