﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20313	AnonymousUser should follow custom User implementation	thinkingpotato@…	thinkingpotato	"Introducing custom User classes opened a few new options for handling authorization logic, e.g.:

{{{
self.request.user.has_purchased(object)
}}}

or as @akaariai mentioned:

{{{
request.user.has_role_in_org(some_org)
}}}

Without being able to define custom AnonymousUser class that follows User implementation this will not work.

There are some ideas on how to solve that, and the ones discussed are:
* defining {{{anonymous_user_class}}} on {{{UserClass}}} (@akaariai)
* merging {{{User}}} and {{{AnonymousUser}}} (@apollo13)

The current dirty patch uses the same approach as with {{{get_user_model()}}}:
* django.contrib.auth.get_anonymous_model
* django.conf.global_settings.AUTH_ANONYMOUS_MODEL

and changes in:
* django.contrib.auth.context_processors
* django.db.models.sql.where.WhereNode"	New feature	assigned	contrib.auth		Normal			julenx@… Sergey Fedoseev Tobias Wiese Evstifeev Roman	Accepted	0	0	0	0	0	0
