Add way to tell if the session is anonymous
authorSimo Sorce <simo@redhat.com>
Sun, 23 Feb 2014 23:35:59 +0000 (18:35 -0500)
committerSimo Sorce <simo@redhat.com>
Tue, 25 Feb 2014 01:30:06 +0000 (20:30 -0500)
Signed-off-by: Simo Sorce <simo@redhat.com>
ipsilon/util/user.py

index dd4b002..387df11 100755 (executable)
@@ -45,6 +45,12 @@ class User(object):
         self.name = None
         self._userdata = dict()
 
+    @property
+    def is_anonymous(self):
+        if self.name:
+            return False
+        return True
+
     @property
     def is_admin(self):
         if 'is_admin' in self._userdata: