Permission to anonymous
|Reported by:||niarium||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Granting a permission to anonymous is needed.
The situation goes like this. You have a forum application, and, in the forum model, you have some ForeignKeys (to permission) that will correspond to the actions you can take in a forum, like reading writing listing and commenting. Some forums are supposed to be read and written by anonymous users. However, no matter what permission I assign for the reading action, the method request.user.has_perm always returns false if the user is not logged in.
There are workarounds, one of them being that you give null=true and blank=true to those ForeignKeys and check whether they are None or not before calling has_perm. But then you need an extra line of code and will lose the consistency, treating anonymous permissions very specially.
Trac (which the django project itself uses for development too) has permission to anonymous, making it easier to set actions to be taken by anonymous. It will be great for django to have that too.