Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#9036 closed (fixed)

Discrepancy in admin permissions

Reported by: anonymous Owned by: manuq
Component: contrib.admin Version: 1.0
Severity: Keywords: pycamp2009
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

in django.contrib.admin.sites.AdminSite.index permissions are calculated like so:

                perms = {
                    'add': model_admin.has_add_permission(request),
                    'change': model_admin.has_change_permission(request),
                    'delete': model_admin.has_delete_permission(request),
                }

but then in django.contrib.admin.sites.AdminSite.app_index permissions are done like this:

                    perms = {
                        'add': user.has_perm("%s.%s" % (app_label, model._meta.get_add_permission())),
                        'change': user.has_perm("%s.%s" % (app_label, model._meta.get_change_permission())),
                        'delete': user.has_perm("%s.%s" % (app_label, model._meta.get_delete_permission())),
                    }

Personally I perfer the way that index does it, but either way, it just needs to be standardized so we don't have different pages giving different results.

Attachments (2)

sites.diff (1001 bytes ) - added by leanmeandonothingmachine 16 years ago.
9036-index_perms_discrepancy.diff (954 bytes ) - added by manuq 16 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by anonymous, 16 years ago

by leanmeandonothingmachine, 16 years ago

Attachment: sites.diff added

comment:2 by leanmeandonothingmachine, 16 years ago

Has patch: set

comment:3 by Jacob, 16 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:4 by Jacob, 16 years ago

The way index does it is correct and should be used in both cases.

comment:5 by manuq, 16 years ago

Keywords: pycamp2009 added
Owner: changed from nobody to manuq

comment:6 by manuq, 16 years ago

The patch attached should do it.

comment:7 by Jacob, 16 years ago

Resolution: fixed
Status: newclosed

Fixed in r10451

comment:8 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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