November 2015
Beginner to intermediate
840 pages
26h 30m
English
The group and permission system in place for Django is very basic—permissions control a type of object (models). Django does not provide the code necessary to checking permissions on specific objects. However, Django does anticipate that you might want this behavior. The definition of many of the permission-checking methods allows for an optional obj argument, as shown in Example 20.30.
Example 20.30: Python Code
has_perm(perm, obj=None) has_perms(perm_list, obj=None) get_group_permissions(obj=None) get_all_permissions(obj=None)
The documentation states that “if obj is passed in, this method won’t check for a permission for the model, but for this specific object.” This statement ...
Read now
Unlock full access