emont88 wrote:
> I just switched over to the newforms-admin branch because I need to
> add specific permissions to my admin site.
> I have been looking over the newforms-admin howto and the ModelAdmin
> class, but I haven't been able to figure very much out.
>
> My app is a blogging app that needs to support multiple blogs, each
> with multiple authors.  Each author will only have access to edit a
> single blog.  Basically, I think I just need to figure out row-level
> permissions, but I'm not sure where to start.

Study the class ModelAdmin in the file django/contrib/admin/
options.py.

There are has_*_permission() methods there that you can override in
your own Admin class. There's an example of an overridden
has_change_permission method in the docs: 
http://code.djangoproject.com/wiki/NewformsAdminBranch

>
> Also, since an author can only post to a single blog, I need to be
> able to set the Entry.author and Entry.blog fields automatically when
> they are writing a new post, based on the currently signed-in User.
> I'm not sure how to add that either since you can't just access
> request.user within Entry's save() method.


Your Admin class could override the ModelAdmin.save_add()
and .change_add() methods. In these methods, you will have access to
the request object from which you can do your request.user magic.

-RD

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

Reply via email to