I also had to implement view permissions on admin, and in my opinion,
the worst thing of implementing full support for view permissions is
that you have to **copy&paste all the change_view and
changelist_view** just for changing one conditional:
if not self.has_change_permission(request, obj):
raise PermissionDenied
replace with:
# change_view
if not self.has_view_permission(request, obj):
raise PermissionDenied
if request.method == 'POST' and not self.has_change_permission(request, obj):
raise PermissionDenied
# changelist_view
if not self.has_view_permission(request, None):
raise PermissionDenied
So for me this is not one of those situations that you can say: oh if
you want it, just implement it on your own. Because doing so it's just
a mess.
br.
On Wed, Jan 16, 2013 at 8:13 AM, Jonas Obrist <[email protected]> wrote:
> For what it's worth is love to see this in core too.
>
> my use case was for DjangoCon Europe where admins were allowed to see ticket
> info, but only "super admins" were allowed to change them as changes likely
> had an impact on payments etc too (read PayPal). The solution was that
> everyone had change/add permission, only super admins had delete perms.
> Further I changed get_readonly_fields to mark everything read-only for
> non-super admins. That was perfectly doable but was needlessly complicated in
> my opinion.
>
> it could be solved in a third party app but I'd argue having this option by
> default would be beneficial to lots of users.
>
> just my two cents...
>
> Jonas
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-developers/-/fPvFtNkTax4J.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>
--
Marc
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.