Opened 6 years ago

Closed 6 years ago

#10649 closed (duplicate)

Permission to anonymous

Reported by: niarium Owned by: nobody
Component: Uncategorized Version:
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

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.

Change History (1)

comment:1 Changed 6 years ago by ubernostrum

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #9444.

Note: See TracTickets for help on using tickets.
Back to Top