Changes between Initial Version and Version 1 of Ticket #16862
- Timestamp:
- Sep 16, 2011, 5:38:53 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #16862
- Property Has patch set
- Property Needs tests set
- Property Triage Stage Unreviewed → Accepted
- 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 overrideModelAdmin for my object permission Backend like this1 I'm overriding ModelAdmin for my object permission Backend like this 2 2 3 {{{ 3 4 def has_delete_permission(self, request, obj=None): 4 5 opts = self.opts 5 6 return request.user.has_perm(opts.app_label + '.' + opts.get_delete_permission(), obj) # pass parm obj 7 }}} 6 8 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. 9 but 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". 9 10 10 in the django.contrib.admin.utils.get_deleted_objects not pass parm "obj" to detect the permission for related deleted obj. 11 Why? I try to find the root of the problem. 12 13 In django.contrib.admin.utils.get_deleted_objects, it doesn't pass "obj" to detect the permission for related deleted obj. 11 14 Django did not provide extension points,I can only change the django source code. 12 15 13 when i try to implement object permission for django admin,What is the best solution,thank you.16 When I try to implement object permissions for django admin, what is the best solution? Thank you.