Documentation on has_perm and the permission_required decorator is confusing
|Reported by:||wallenfe||Owned by:||Jacob|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The documentation on using has_perm and permission_required is confusing in that it does not define how the permission string that is passed to those functions is defined.
The documentation should mention that the string is:
Since Permissions are defined on models, my first inclination was to try: ModelName.PermissionName
This is the documentation page I am referring to:
And an example of the permission string being used, but without an explanation.
if not (request.user.is_authenticated() and request.user.has_perm('polls.can_vote')):
Change History (8)
comment:5 Changed 7 years ago by
|Triage Stage:||Accepted → Ready for checkin|
|Version:||1.0 → SVN|