From 0ae93d551460ca0353c0304941064aa781722dd2 Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Wed, 27 Sep 2017 10:19:46 +0200 Subject: [PATCH] added acls for root resource --- ordr2/resources/__init__.py | 5 +++++ ordr2/views/pages.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ordr2/resources/__init__.py b/ordr2/resources/__init__.py index ebb7a68..431f199 100644 --- a/ordr2/resources/__init__.py +++ b/ordr2/resources/__init__.py @@ -1,3 +1,5 @@ +from pyramid.security import Allow, Everyone + class Root(object): ''' Root resource ''' @@ -7,6 +9,9 @@ class Root(object): def __init__(self, request): self._request = request + def __acl__(self): + return [ (Allow, Everyone, 'view') ] + def includeme(config): ''' diff --git a/ordr2/views/pages.py b/ordr2/views/pages.py index b9373ac..d5df102 100644 --- a/ordr2/views/pages.py +++ b/ordr2/views/pages.py @@ -4,6 +4,7 @@ from pyramid.view import view_config @view_config( context='ordr2.resources.Root', + permission='view', renderer='../templates/pages/welcome.jinja2' ) def welcome(context, request): @@ -13,6 +14,7 @@ def welcome(context, request): @view_config( context='ordr2.resources.Root', name='faq', + permission='view', renderer='../templates/pages/faq.jinja2' ) def faqs(context, request):