#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)
Change History (10)
comment:1 by , 17 years ago
by , 17 years ago
| Attachment: | sites.diff added |
|---|
comment:2 by , 17 years ago
| Has patch: | set |
|---|
comment:3 by , 17 years ago
| milestone: | → 1.1 |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:4 by , 17 years ago
comment:5 by , 17 years ago
| Keywords: | pycamp2009 added |
|---|---|
| Owner: | changed from to |
by , 17 years ago
| Attachment: | 9036-index_perms_discrepancy.diff added |
|---|
Note:
See TracTickets
for help on using tickets.
The way
indexdoes it is correct and should be used in both cases.