#37021: Add a helper function to return the permission string representation to 
be
used with `user.has_perm()`
-------------------------------------+-------------------------------------
     Reporter:  Mariatta             |                    Owner:  (none)
         Type:  New feature          |                   Status:  closed
    Component:  contrib.auth         |                  Version:  6.0
     Severity:  Normal               |               Resolution:
                                     |  needsnewfeatureprocess
     Keywords:  codename, has_perm   |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

 * keywords:   => codename, has_perm
 * resolution:   => needsnewfeatureprocess
 * status:  new => closed

Comment:

 Thanks for the idea. I'm very tempted to accept this, because the lack of
 this feature can lead to the temptation to hard-code the app label.
 (#26547 points out this is incorrect if the `AppConfig` overrides the
 label).

 However, although it's just a one-liner, forcing the user to write it
 themselves will probably alert them to the need to JOIN the content types,
 or otherwise do an annotation, to avoid an N+1 query problem.

 As silly as it might sound to go through the new feature process for this,
 I think getting some confirming views there would be useful. Can I ask you
 to repeat your request there, and mention the temptation to do it the
 "wrong" way by hard-coding the app label?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/37021#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019d4fb06031-58c09d0e-414c-4772-8eae-77c50734cc3a-000000%40eu-central-1.amazonses.com.

Reply via email to