comparison src/server/session_iface.py @ 1101:9f7a628ce893

server (session): new "guest" property, True when connected user is a guest
author Goffi <goffi@goffi.org>
date Fri, 01 Jun 2018 18:32:39 +0200
parents 8a270f32de81
children cdd389ef97bc
comparison
equal deleted inserted replaced
1100:5976dcd42591 1101:9f7a628ce893
56 return os.path.join(u'/', C.CACHE_DIR, self.uuid) + u'/' 56 return os.path.join(u'/', C.CACHE_DIR, self.uuid) + u'/'
57 57
58 @property 58 @property
59 def connected(self): 59 def connected(self):
60 return self.profile is not None 60 return self.profile is not None
61
62 @property
63 def guest(self):
64 """True if this is a guest session"""
65 if self.profile is None:
66 return False
67 else:
68 return self.profile.startswith('guest@@')
61 69
62 def getPageData(self, page, key): 70 def getPageData(self, page, key):
63 """get session data for a page 71 """get session data for a page
64 72
65 @param page(LiberviaPage): instance of the page 73 @param page(LiberviaPage): instance of the page