First pass (still haven't figured out how to test it):
https://github.com/satchamo/django/commit/d5accc17122cd7486a5e5fd2d63b4c1f732a5c68

It's not obvious from the diff, but AnonymousUser depends on permission 
stuff (see AnonymousUser._get_groups/_get_user_permissions). On top of 
that, AnonymousUser.get_all_permissions/has_perm/has_module_perms now have 
function level imports. I'm tempted to move the 
_user_has_perm/_user_get_all_permissions/_user_has_module_perms 
helpers into base_user too.


On Wednesday, March 23, 2016 at 4:19:58 PM UTC-7, Florian Apolloner wrote:
>
>
>
> On Thursday, March 24, 2016 at 12:07:14 AM UTC+1, Matt wrote:
>>
>> >  the ModelBackend uses the Permission model, so why would that ever 
>> work without beeing in INSTALLED_APPS?
>>
>> ModelBackend.authenticate() doesn't use the permissions models. And 
>> that's the method that gets used when authenticating a user. If I did 
>> something like `user.has_perm()`, things would blow up. But that is easy to 
>> override on your custom User class.
>>
>
> Fair enough.
>  
>
>> > the context_processor will break due to the AnonymousUser most likely
>>
>> Hmm, right...I suppose AnonymousUser could be refactored into 
>> base_user.py.
>>
>
> Yes, but we should keep an import in models.py for compatibility.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/2e68493e-93b7-4303-b733-20b9be2f344e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to