Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Modifying default permissions given to a model [RSS Feed]

#1 Dec. 23, 2010 00:08:12

B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Modifying default permissions given to a model


Hello All:

I am creating a model that should only be 'read-only' in the admin.
That is, the only way to add new records in the database for this
model is through the code, not manually.

However, I would like the admin user to be able to view entries in
this model. An example of such a model would be a system log - users
can't write to a system log, but they can view it.

So I would like to know of a way to prevent 'add' permissions being
added to models in this application - in other words, modify the
default permissions set by the django admin application.

Currently I am manually removing "add" permissions by listening to the
post_save signal, but this doesn't remove the permissions from the
django "add users" form, and am thinking of writing a SQL hack to
remove these permissions as part of manage.py syncdb, but I'm hoping
there is a simpler way to do this.

Thanks for any pointers.

Django version: 1.2.3

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Modifying default permissions given to a model [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support