Browse Source

added acls for root resource

php2python
Holger Frey 7 years ago
parent
commit
0ae93d5514
  1. 5
      ordr2/resources/__init__.py
  2. 2
      ordr2/views/pages.py

5
ordr2/resources/__init__.py

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
from pyramid.security import Allow, Everyone
class Root(object):
''' Root resource '''
@ -7,6 +9,9 @@ class Root(object): @@ -7,6 +9,9 @@ class Root(object):
def __init__(self, request):
self._request = request
def __acl__(self):
return [ (Allow, Everyone, 'view') ]
def includeme(config):
'''

2
ordr2/views/pages.py

@ -4,6 +4,7 @@ from pyramid.view import view_config @@ -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): @@ -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):