Ticket #9646: ticket-9646.diff

File ticket-9646.diff, 1.0 KB (added by tadamcik@…, 15 years ago)

Change app_index permission checks to match index's checks

  • contrib/admin/sites.py

     
    340340            if app_label == model._meta.app_label:
    341341                if has_module_perms:
    342342                    perms = {
    343                         'add': user.has_perm("%s.%s" % (app_label, model._meta.get_add_permission())),
    344                         'change': user.has_perm("%s.%s" % (app_label, model._meta.get_change_permission())),
    345                         'delete': user.has_perm("%s.%s" % (app_label, model._meta.get_delete_permission())),
     343                        'add': model_admin.has_add_permission(request),
     344                        'change': model_admin.has_change_permission(request),
     345                        'delete': model_admin.has_delete_permission(request),
    346346                    }
    347347                    # Check whether user has any perm for this module.
    348348                    # If so, add the module to the model_list.
Back to Top