#13539: The delete confirmation page does not check for object-level permissions
when building the related list
-------------------------------------+-------------------------------------
     Reporter:  Ion Scerbatiuc       |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  contrib.admin        |                  Version:  1.8
     Severity:  Normal               |               Resolution:
     Keywords:  delete object-level  |             Triage Stage:  Accepted
  permissions                        |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  1                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Alexander Todorov):

 Scratch my previous comment.

 I think I've figured out the reasoning behind returning empty set when obj
 is passed: if you want to get all perms for the specified object then this
 is an empty set() because the ModelBackend doesn't support object-level
 permissions.  Sounds reasonable to me but took some time to figure it out.

 Replying to [comment:19 Virtosu Bogdan]:
 > Can't the check be changed to `user.has_perm(p) or user.has_perm(p,
 obj)` ?

 I've tried this approach in https://github.com/django/django/pull/13418
 and all local tests passed for me.


 @felixxm I'm sorry for cross posting but these tickets are probably one
 and the same issue and the latest approach seems to work. Can you comment
 on that ?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/13539#comment:21>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/068.1a116b6506b4deda496088b914f18117%40djangoproject.com.

Reply via email to