What can Django-Guardian do that is not possible by Django Auth Permissions?

StackOverflow https://stackoverflow.com/questions/16333135

  •  14-04-2022
  •  | 
  •  

سؤال

What are the features that django-guardian provides that are not already provided by django auth's permissions?

Here are the features listed by django-guardian's documentation:

  • Object permissions for Django
  • AnonymousUser support
  • High level API
  • Heavely tested
  • Django’s admin integration
  • Decorators

What does 'Object-level' permission mean? Is it the same as assigning permission to object instance which is already supported by in auth's permission?

"Permissions can be set not only per type of object, but also per specific object instance."

https://docs.djangoproject.com/en/dev/topics/auth/default/#default-permissions

هل كانت مفيدة؟

المحلول

Django auth's can do all this and more, Guardian takes advantage of this and put is all in a nice package with a good API to boot.

Have a look here on the differences django-object-permissions Vs django-guardian Vs django-authority

What does 'Object-level' permission mean?

In a wider context think of it like this. Imagine you have a profile, on that profile you can make it public, private or viewable to friends, either allowing others to view your profile or no one all.

It's the ability to limit access to specific records, rather than entire tables.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top