Permission support for admin inlines

11 views
Skip to first unread message

Simon Litchfield

unread,
Oct 26, 2010, 5:15:12 PM10/26/10
to Django developers
The ModelAdmin's permission hooks are great- has_add_permission,
has_change_permission, and has_delete_permission.

It would be nice if they were supported by inlines in the same way; ie
InlineModelAdmin, StackedInline, TabularInline, GenericStackedInline,
GenericTabularInline.

UI is fairly obvious; has_add would result in no add form; has_delete
in no delete tick box; and for has_change, showing as readonly_fields
would probably be easiest.

Any thoughts?

Simon Meers

unread,
Oct 26, 2010, 5:25:48 PM10/26/10
to django-developers

This should be considered together with the question of whether the user's general permissions should apply to inlines [1], which is in DDN at present.

[1] http://code.djangoproject.com/ticket/8060

Florian Apolloner

unread,
Oct 27, 2010, 8:44:29 AM10/27/10
to Django developers
Hi,

the permission checking should be doable if my ideas from
http://groups.google.com/group/django-developers/browse_thread/thread/bfad2774ff7c357b#
get in. So if someone can come up with a proper api as suggested by
Russell I'd be happy to help codewise (this way we could even work
around the DDN, as it leaves the user the choice to implement
permission checks the way he wants to).

Cheers, Florian

Harro

unread,
Oct 27, 2010, 12:15:39 PM10/27/10
to Django developers
Right now I often use the fact that inlines don't have permissions a
lot to hide the items in the admin and show them inline on another
item.
Say I have images linked to a product. When I edit the product I can
add a maximum of 3 images. I can enforce this with the inlines and
then don't give permission to edit the images directly.

So I think having it on inlines is great but it should be
configurable.

On Oct 27, 2:44 pm, Florian Apolloner <f.apollo...@gmail.com> wrote:
> Hi,
>
> the permission checking should be doable if my ideas fromhttp://groups.google.com/group/django-developers/browse_thread/thread...
Reply all
Reply to author
Forward
0 new messages