Mercurial > libervia-web
changeset 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 | 5976dcd42591 |
children | 8b70c838ed14 |
files | src/server/session_iface.py |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/server/session_iface.py Fri Jun 01 18:31:29 2018 +0200 +++ b/src/server/session_iface.py Fri Jun 01 18:32:39 2018 +0200 @@ -59,6 +59,14 @@ def connected(self): return self.profile is not None + @property + def guest(self): + """True if this is a guest session""" + if self.profile is None: + return False + else: + return self.profile.startswith('guest@@') + def getPageData(self, page, key): """get session data for a page