Hi,

I my scenario users can only edit some model if thy are also the
authors.
With the permission_required_decorator this is not possible.

So what about the user_passes_test-decorator.
I want to do something like this:

def user_can_edit(user, model):
   if user.is_authenticated and user == model.author:
          return True
   else:
         return False

So the problem is, how do I pass the <code>model</code>? Is there a
way to this, or do I have to write my own decorator?

Thanks, Toni
--~--~---------~--~----~------------~-------~--~----~
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