#30028: Uneditable object still editable through change_list if list_editable 
not
empty
-------------------------------+--------------------------------------
     Reporter:  ksl            |                    Owner:  nobody
         Type:  Bug            |                   Status:  closed
    Component:  contrib.admin  |                  Version:  2.1
     Severity:  Normal         |               Resolution:  worksforme
     Keywords:  changelist     |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by ksl):

 Replying to [comment:4 Carlton Gibson]:
 > Happy to look at a project if you can provide one but just glancing at
 the code, it looks like a programming error: you’re going to need to look
 at the `request.user` to see what you should return. Otherwise you’ve
 overridden the default implementation, which protects against this sort of
 thing, and created the issue.
 >
 > You should probably be calling `super()` before your own logic, and only
 continuing if that returns `True`.

 Please find enclosed a test project reflecting our situation. In this
 project, the Question object with ID 1 should be the only one editable.
 As you understand, our logic here is not based on per-user permission
 (hence we do not use `request.user` nor do we call `super()`) but on
 **per-object** permission.

 Test project credentials:

 * User `admin` with password `adminadmin`
 * User `notadmin` with password `adminadmin`

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30028#comment:6>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.0cc2f82392377b83bfb7d4a5977b5f78%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to