Hi Everyone,

I would like to implement different views in admin panel based on the user.

if the user is any other user apart from admin

then for all those models, the user should just be able to see those
objects,( no change, delete and add).
Those users should also not see the select boxes or basically select all.

So by default django provides three permissions, add, delete,change. I
would like to add one more permission on admin panel.

I know this could be done on our own views through this

class USCitizen(models.Model):
    # ...
    class Meta:
        permissions = (
            ("can_drive", "Can drive"),
            ("can_vote", "Can vote in elections"),
            ("can_drink", "Can drink alcohol"),
        )


{% if perms.foo %}
    <p>You have permission to do something in the foo app.</p>
    {% if perms.foo.can_vote %}
        <p>You can vote!</p>
    {% endif %}
    {% if perms.foo.can_drive %}
        <p>You can drive!</p>
    {% endif %}
{% else %}
    <p>You don't have permission to do anything in the foo app.</p>
{% endif %}


But how to do the same thing on the django admin. Also, how to remove
the select all functionality for selected users.

--RJ

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to