Ticket #16724: 16724.user-permission-hooks.diff

File 16724.user-permission-hooks.diff, 1021 bytes (added by Julien Phalip, 13 years ago)

For the record, a diff patch for the (invalid) requested change.

  • django/contrib/admin/options.py

    diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
    index cf7ea83..7dd5282 100644
    a b class ModelAdmin(BaseModelAdmin):  
    387387        request has permission to change *any* object of the given type.
    388388        """
    389389        opts = self.opts
    390         return request.user.has_perm(opts.app_label + '.' + opts.get_change_permission())
     390        return request.user.has_perm(opts.app_label + '.' + opts.get_change_permission(), obj)
    391391
    392392    def has_delete_permission(self, request, obj=None):
    393393        """
    class ModelAdmin(BaseModelAdmin):  
    401401        request has permission to delete *any* object of the given type.
    402402        """
    403403        opts = self.opts
    404         return request.user.has_perm(opts.app_label + '.' + opts.get_delete_permission())
     404        return request.user.has_perm(opts.app_label + '.' + opts.get_delete_permission(), obj)
    405405
    406406    def get_model_perms(self, request):
    407407        """
Back to Top