Hi Harro,

> Hmm I guess I'll just have to keep on hacking django then..
> because that 1% case is something I keep running into for every
> project in one way or another.
> And if it was designed for most apps, why was the row level
>  permission bits added? It's useless without simply always being
>  able to call request.user.has_perm('permission', obj)

Despite a slight overstatement in that last paragraph, your argument 
seems pretty good to me.  The whole point of these methods is to allow 
custom backends to implement their own logic, so obviously it is 
pointless to arbitrarily limit it.

The only downside is that custom backends need to be able to cope with 
anonymous users being passed to the has_perm methods, but that is 
already well catered for with the is_anonymous() method.  It is also 
better to make this change before 1.2 lands, otherwise we have a 
slight backwards incompatibility if we wanted to do it in the future 
(backends could break if they unexpectedly got an AnonymousUser 
instead of a User).

Anyone got a good reason reason why this *shouldn't* go in? I'm +1 on 
committing.

Some small tweaks to the patch will help:
- 'set()' is nicer than 'set([])'
- in topics/auth.html, it would be nice to document that the backend 
should be able to cope with anonymous users being passed to 
has_perm().

Luke

-- 
"Pessimism: Every dark cloud has a silver lining, but lightning 
kills hundreds of people each year trying to find it." (despair.com)

Luke Plant || http://lukeplant.me.uk/

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


Reply via email to