diff src/server/constants.py @ 917:86563d6c83b0

server: Libervia pages: - introduce new LiberviaPage which are easy to create web pages tailored for SàT architecture. They are expected to be the cornerstone of the future of Libervia. - webpages paths reflected by files paths in src/pages directory (directory should be changeable in the future) - if a pages subdirectory as a page_meta.py file, it is a webpage, same for sub-subdirectories and so on - page_meta.py variable are used to instanciate the resource. Check __init__ docstring for details - access is set with a page_meta.py variable (only public for now), and subdirectories access are restricted by parent directory ones. - callables in page_meta.py get 2 arguments: the LiberviaPage resource instance, and the request - callables there can use Deferred (or not) - LiberviaPage has a couple of helper method to e.g. parse URL or return an error
author Goffi <goffi@goffi.org>
date Sun, 05 Mar 2017 23:56:31 +0100
parents 5cefc6ab302f
children 16d1084d1371
line wrap: on
line diff
--- a/src/server/constants.py	Sun Mar 05 23:16:32 2017 +0100
+++ b/src/server/constants.py	Sun Mar 05 23:56:31 2017 +0100
@@ -32,6 +32,7 @@
     THEMES_URL = "themes"
     MEDIA_DIR = "media/"
     CARDS_DIR = "games/cards/tarot"
+    PAGES_DIR = u"pages"
 
     ERRNUM_BRIDGE_ERRBACK = 0  # FIXME
     ERRNUM_LIBERVIA = 0  # FIXME
@@ -48,3 +49,10 @@
     STATIC_RSM_MAX_LIMIT = 100
     STATIC_RSM_MAX_DEFAULT = 10
     STATIC_RSM_MAX_COMMENTS_DEFAULT = 10
+
+    ## Libervia pages ##
+    PAGES_META_FILE = u"page_meta.py"
+    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)