A general can_view permission not respected by the admin is not a good idea.

However an easy way to add a general permission to every model in the
system in one go would be interesting - a hook into
https://github.com/django/django/blob/7da3923ba0c569aa23d0ab0a47a124af60a18f5b/django/contrib/auth/management/__init__.py
somehow which allows a couple of lines to add you automatic "can_view", but
could also be useful for a general "can_escalate_to_legal", "can_unarchive"
or whatever domain specific logic is relevant to most models in a system
without having to explicitly add it for every model.

On 8 July 2015 at 05:37, Григорий Крамаренко <djbal...@gmail.com> wrote:

> Whether I don't understand you, or you me.
>
> Permissions in the admin work on the principle of:
>
> access = is_stuff and True in (add_perm, change_perm, delete_perm)
>
> "view" absolutly not affect to the admin panel, just as do not affect to
> it other custom permissions.
> Take a look at this permission as a custom, but installed by default for
> all models.
> Don't think of it as the permissions for the admin.
> This permission is for writing business applications or complex web-sites
> using Django. Using more serious administrative panel than contrib.admin.
> Let's write this clearly in the documentation. And just.
>
> P.S.: Who would want to use "view" in contrib.auth - do it youself. It
> will be very easy.
>
> среда, 8 июля 2015 г., 1:54:53 UTC+10 пользователь Florian Apolloner
> написал:
>>
>> It absolutely does, cause if you assign the "view" permission to a user
>> he should be able to see the changelist, which wouldn't be the case, see
>> https://github.com/django/django/blob/master/django/contrib/admin/options.py#L1447-L1448
>> -- similar issues would pop up on the app overview etc…
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/39249ee0-b10b-4ee9-b7bb-ee8aac39e374%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/39249ee0-b10b-4ee9-b7bb-ee8aac39e374%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMwjO1HryB9Ygec%3DoS6%3Dhw2rfKecrsLR%3DHPTdYYJMmy7DQfKsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to