summaryrefslogtreecommitdiff
path: root/django/parts/auth/anonymoususers.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/parts/auth/anonymoususers.py')
-rw-r--r--django/parts/auth/anonymoususers.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/django/parts/auth/anonymoususers.py b/django/parts/auth/anonymoususers.py
new file mode 100644
index 0000000000..2a86911f15
--- /dev/null
+++ b/django/parts/auth/anonymoususers.py
@@ -0,0 +1,48 @@
+"""
+Anonymous users
+"""
+
+class AnonymousUser:
+
+ def __init__(self):
+ pass
+
+ def __repr__(self):
+ return 'AnonymousUser'
+
+ def save(self):
+ raise NotImplementedError
+
+ def delete(self):
+ raise NotImplementedError
+
+ def set_password(self, raw_password):
+ raise NotImplementedError
+
+ def check_password(self, raw_password):
+ raise NotImplementedError
+
+ def get_groups(self):
+ return []
+
+ def set_groups(self, group_id_list):
+ raise NotImplementedError
+
+ def get_permissions(self):
+ return []
+
+ def set_permissions(self, permission_id_list):
+ raise NotImplementedError
+
+ def has_perm(self, perm):
+ return False
+
+ def get_and_delete_messages(self):
+ return []
+
+ def add_session(self, session_md5, start_time):
+ "Creates Session for this User, saves it, and returns the new object"
+ raise NotImplementedError
+
+ def is_anonymous(self):
+ return True