Changes between Initial Version and Version 1 of Ticket #16862


Ignore:
Timestamp:
Sep 16, 2011, 5:38:53 AM (13 years ago)
Author:
Carl Meyer
Comment:

Yes, get_deleted_objects should pass on the specific object in that permission check. Thanks for the report!

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16862

    • Property Has patch set
    • Property Needs tests set
    • Property Triage Stage UnreviewedAccepted
    • Property Summary I'm try to implement object permission on django admin.Admin delete-cascade check doesn't support per-object permissions
  • Ticket #16862 – Description

    initial v1  
    1 i'm override ModelAdmin for my object permission Backend like this
     1I'm overriding ModelAdmin for my object permission Backend like this
    22
     3{{{
    34def has_delete_permission(self, request, obj=None):
    45    opts = self.opts
    56    return request.user.has_perm(opts.app_label + '.' + opts.get_delete_permission(), obj)     # pass parm obj
     7}}}
    68
    7 but when i delete the obj,System back to me "Deleting the article 'test' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:article".
    8 why? i try to find the Root of the problem.
     9but when i delete the obj, I get "Deleting the article 'test' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:article".
    910
    10 in the django.contrib.admin.utils.get_deleted_objects not pass parm "obj" to detect the permission for related deleted obj.
     11Why? I try to find the root of the problem.
     12
     13In django.contrib.admin.utils.get_deleted_objects, it doesn't pass "obj" to detect the permission for related deleted obj.
    1114Django did not provide extension points,I can only change the django source code.
    1215
    13 when i try to implement object permission for django admin,What is the best solution,thank you.
     16When I try to implement object permissions for django admin, what is the best solution? Thank you.
Back to Top