Sunday, August 31, 2014

How create a custom permission for a model?

Hi, how are you?

I have the next question:

Good Nights, this is a question, not a issue.

I need have to user's types: a default admin in django, and a author.
Default admin have a aditional permission: can publish a news.
And for author user i have the next constrains:

  • Can't publish news.
    • Can't create other users
    • Can't create other topics or subtopics
    • Can create a new, but, only can edit or delete his own news, no other user's news.

I talked with other friend and he say me that i need per-objetcs permissions, but, i don't know how do this.

Can you help me?


Now i'm ussing django-permission, but i don't know how do a custom can_publish permission.


I wan't cread a custom view, no, i want used django's admin, news model have a boolean field, is_published, i want that if the user is Author, can modify this field, and if is admin, can modify this field, can anyone help me?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/06752534-dd11-4422-a0cb-25cc81ca077c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment