diff src/server/constants.py @ 922:16d1084d1371

server (pages): added "None" access (page is not rendered at all) and some HTTP code constants + helper methods to get session data
author Goffi <goffi@goffi.org>
date Mon, 03 Apr 2017 01:00:26 +0200
parents 86563d6c83b0
children 8a393ae90f8c
line wrap: on
line diff
--- a/src/server/constants.py	Mon Apr 03 00:53:09 2017 +0200
+++ b/src/server/constants.py	Mon Apr 03 01:00:26 2017 +0200
@@ -52,7 +52,13 @@
 
     ## Libervia pages ##
     PAGES_META_FILE = u"page_meta.py"
+    PAGES_ACCESS_NONE = u"none"  # no access to this page (using its path will return a 404 error)
     PAGES_ACCESS_PUBLIC = u"public"
     PAGES_ACCESS_PROFILE = u"profile"  # a session with an existing profile must be started
     PAGES_ACCESS_ADMIN = u"admin"  # only profiles set in admins_list can access the page
-    PAGES_ACCESS_ALL = (PAGES_ACCESS_PUBLIC, PAGES_ACCESS_PROFILE, PAGES_ACCESS_ADMIN)
+    PAGES_ACCESS_ALL = (PAGES_ACCESS_NONE, PAGES_ACCESS_PUBLIC, PAGES_ACCESS_PROFILE, PAGES_ACCESS_ADMIN)
+
+    ## HTTP codes ##
+    HTTP_BAD_REQUEST = 400
+    HTTP_UNAUTHORIZED = 401
+    HTTP_NOT_FOUND = 404