Added a fake guest user class; stubbed out permissions.
[zzz-spline-users.git] / splinext / users / __init__.py
index 73f2029..a6a6ca7 100644 (file)
@@ -31,9 +31,8 @@ def check_userid_hook(action, **params):
     c.
     """
 
     c.
     """
 
-    c.user = None
-
     if not 'user_id' in session:
     if not 'user_id' in session:
+        c.user = users_model.AnonymousUser()
         return
 
     user = meta.Session.query(users_model.User).get(session['user_id'])
         return
 
     user = meta.Session.query(users_model.User).get(session['user_id'])
@@ -41,6 +40,8 @@ def check_userid_hook(action, **params):
         # Bogus id in the session somehow.  Clear it
         del session['user_id']
         session.save()
         # Bogus id in the session somehow.  Clear it
         del session['user_id']
         session.save()
+
+        c.user = users_model.AnonymousUser()
         return
 
     c.user = user
         return
 
     c.user = user