selectors.py
branchtls-sprint
changeset 828 394927376a01
parent 810 154bf8cfd65b
child 833 8c6bfd9158fb
--- a/selectors.py	Wed Feb 18 20:23:43 2009 +0100
+++ b/selectors.py	Wed Feb 18 20:25:12 2009 +0100
@@ -346,17 +346,14 @@
 
 @objectify_selector
 @lltrace
-def anonymous_user(cls, req, *args, **kwargs):
+def authenticated_user(cls, req, *args, **kwargs):
     """accept if user is anonymous"""
     if req.cnx.anonymous_connection:
-        return 1
-    return 0
+        return 0
+    return 1
 
-@objectify_selector
-@lltrace
-def authenticated_user(cls, req, *args, **kwargs):
-    """accept if user is authenticated"""
-    return not anonymous_user()(cls, req, *args, **kwargs)
+def anonymous_user():
+    return ~ authenticated_user()
 
 @objectify_selector
 @lltrace