Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing Object Level Permissions #658

Open
1 of 3 tasks
moluwole opened this issue Nov 15, 2024 · 2 comments
Open
1 of 3 tasks

Implementing Object Level Permissions #658

moluwole opened this issue Nov 15, 2024 · 2 comments

Comments

@moluwole
Copy link

moluwole commented Nov 15, 2024

Feature Request Type

  • Core functionality
  • Alteration (enhancement/optimization) of existing feature(s)
  • New behavior

Description

Is there a way to implement Object Level Permissions? Something similar to what we have on Django Rest Framework. This would enable us to determine if a user has access to a particular object or model instance

This would be a great help in a multi-tenancy system where some users would have the same permissions but would only be able to access certain model objects

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@thclark
Copy link
Contributor

thclark commented Dec 2, 2024

This is already completely possible.

Aside: Django rest framework doesn't have object-level permissions out of the box, it usually uses django's permissions framework, to which you can add django-guardian in order to add object-level permissions.

It's the same with strawberry, it integrates with django-guardian to achieve this, and if you search for guardian in the django strawberry docs you'll find it there.

@moluwole
Copy link
Author

moluwole commented Dec 2, 2024

Thanks for the clarification. I've not used django-guardian in the past.
I'll take a look at it

Aside: https://www.django-rest-framework.org/api-guide/permissions/#object-level-permissions. Django Rest Framework does have Object Level Permissions out of the box although it comes with it's own limitations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants