caps.backends

class PermissionsBackend[source]

Bases: BaseBackend

Provide object permission backend using the capabilities system.

The check is only run on Owned and Access instances.

You can add it to the AUTHENTICATION_BACKENDS setting, as:

..code-block:: python

AUTHENTICATION_BACKENDS = [

“django.contrib.auth.backends.ModelBackend”, “caps.backends.PermissionsBackend”,

]

get_all_permissions(user, obj=None)[source]
Return type:

set[str]

has_perm(user, perm, obj=None)[source]
Return type:

bool