Skip to main content

PermLookupDict

This class provides a dictionary-like interface for checking a user's permissions within a specific application. It allows for boolean checks on module-level permissions and individual permission lookups via key access. Note that this class is explicitly non-iterable and will raise a TypeError if iteration is attempted.

Attributes

AttributeTypeDescription
user[User](../../models/user.md?sid=django_contrib_auth_models_user)The user instance whose permissions are being queried by the lookup dictionary.
app_labelstringThe application identifier used as a namespace prefix when checking for specific permissions.

Constructor

Signature

def PermLookupDict(
user: object,
app_label: string
) - > null

Parameters

NameTypeDescription
userobjectThe user object whose permissions are being checked.
app_labelstringThe label of the application for which permissions are being scoped.