---
title: "Comment by Bashko Ali on \"Role-Based Access Control ( RBAC) for NoSQL DB in Nodejs\" | Hashnode"
description: "Hi, thanks for helpful article. I&#39;m really wondering how can we get the resource_id in the middleware to get the right permissions?"
url: "https://hashnode.com/posts/role-based-access-control-rbac-for-nosql-db-in-nodejs/5ff2096a45519f71a3337380/comment/634832331b098b3c50f26a0a"
---

[Discussion](https://hashnode.com/posts/role-based-access-control-rbac-for-nosql-db-in-nodejs/5ff2096a45519f71a3337380)

Comment [Role-Based Access Control ( RBAC) for NoSQL DB in Nodejs](https://hashnode.com/posts/role-based-access-control-rbac-for-nosql-db-in-nodejs/5ff2096a45519f71a3337380)

[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.
