# Question about API security and preventing user from accessing another user's data

**URL:** <https://community.auth0.com/t/question-about-api-security-and-preventing-user-from-accessing-another-users-data/130811>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [March 29, 2024, 6:14pm UTC](https://community.auth0.com/t/question-about-api-security-and-preventing-user-from-accessing-another-users-data/130811 "2024-03-29T18:14:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael33](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michael33/32/60019_2.png) [@michael33](https://community.auth0.com/u/michael33)\
**Post date:** [March 29, 2024, 6:14pm UTC](https://community.auth0.com/t/question-about-api-security-and-preventing-user-from-accessing-another-users-data/130811/1 "2024-03-29T18:14:45Z")

</div>

Forgive me but I’m very new to auth0 concepts and trying to figure something out.

I can see how to use RBAC to secure access to static API endpoints based on a user’s role.

But the problem I’m trying to solve is to secure an API to prevent user 1 from accessing user 2’s data. For example, user 1 should not be able to get /resource/ even if they are logged in properly.

Since the UUID is a path parameter of our api, how can I authorize a given user to only access their data, at the API level? I’ve read about API permissions, and can certainly create a permission for this use case, but I’m not sure how the permission is mapped to the specific route involving a path parameter for the user.

Thanks!

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [March 29, 2024, 7:07pm UTC](https://community.auth0.com/t/question-about-api-security-and-preventing-user-from-accessing-another-users-data/130811/2 "2024-03-29T19:07:23Z")

</div>

Hi @michael33,

Welcome to the Auth0 Community!

Thank you for posting your question. I need to do more research regarding your topic, but have you tried checking out FGA? It seems like it can be beneficial for this kind of context with fine-grained authorization for roles at group-based access.

> **[Fine Grained Authorization (FGA) at scale for developers - Auth0](https://auth0.com/fine-grained-authorization)**
>
> Implement Fine Grained Authorization (FGA) quickly to let users work securely while controlling access using developer friendly API’s in an existing system.

Let me know what you think about FGA.

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![michael33](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michael33/32/60019_2.png) [@michael33](https://community.auth0.com/u/michael33)\
**Post date:** [March 29, 2024, 8:02pm UTC](https://community.auth0.com/t/question-about-api-security-and-preventing-user-from-accessing-another-users-data/130811/3 "2024-03-29T20:02:25Z")

</div>

Thanks for your answer. I did bump into FGA but was not sure whether I’d need to “go there” for my answer 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 12, 2024, 8:03pm UTC](https://community.auth0.com/t/question-about-api-security-and-preventing-user-from-accessing-another-users-data/130811/4 "2024-04-12T20:03:02Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
