[Feature Request] In admin the variable has_change_permission in change_form.html should not be used for the breadcrumb menu
40 views
Skip to first unread message
Jannik Schürg
unread,
Apr 18, 2017, 8:12:09 AM4/18/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django developers (Contributions to Django itself)
In admin when rendering a change form the breadcrumb menu includes a link to the changelist, or only a text. The template’s variable has_change_permission is used to decide which to show.
As far as I understand the variable is set in ModelAdmin to has_change_permissions(request, obj) by default, but a user with has_change_permissions(request, obj=None) returning False will get a permission error clicking the link. I propose to take account of the possibility that the implication
has_change_permissions(request, obj) is True implies
has_change_permissions(request, obj=None) is True
is not true.
The redirect behaviour in ModelAdmin's response_post_save_add et al. seems to handle this case. My implementation idea is to add another template variable in AdminModel's render_change_form.
If this change and implementation is welcomed I can try to create a patch if someone can provide guidance for what to do besides the two one line changes.