django-guardian 1.0.4 documentation

This Page

Backends

ObjectPermissionBackend

class guardian.backends.ObjectPermissionBackend

x.__init__(...) initializes x; see help(type(x)) for signature

has_perm(user_obj, perm, obj=None)

Returns True if given user_obj has perm for obj. If no obj is given, False is returned.

Note

Remember, that if user is not active, all checks would return False.

Main difference between Django’s ModelBackend is that we can pass obj instance here and perm doesn’t have to contain app_label as it can be retrieved from given obj.

Inactive user support

If user is authenticated but inactive at the same time, all checks always returns False.