Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#9646 closed (fixed)

contrib.admin does app index page does not check ModelAdmin.has_add_permission(request)

Reported by: tadamcik@… Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords:
Cc: petar.maric@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The permission checks implemented in the app index page for contrib admin assume that the site is using default Django contrib.auth permssions[1]. On sites with overridden ModelAdmin.has_add_permission [3] this means that the wrong perm string will be checked.

The proposed patch simply makes AdminSite.app_index do the check in the same way as AdminSite.index [2] so that ModelAdmin auth mechanism will be invoked.

[1]: http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/sites.py#L343
[2]: http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/sites.py#L279
[3]: http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/options.py#L211

Attachments (1)

ticket-9646.diff (1.0 KB ) - added by tadamcik@… 15 years ago.
Change app_index permission checks to match index's checks

Download all attachments as: .zip

Change History (5)

by tadamcik@…, 15 years ago

Attachment: ticket-9646.diff added

Change app_index permission checks to match index's checks

comment:1 by Jacob, 15 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:2 by Petar Marić, 15 years ago

Cc: petar.maric@… added

comment:3 by Jacob, 15 years ago

Resolution: fixed
Status: newclosed

This is a dup of #9036, which was fixed in [10451].

comment:4 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top