Holger Frey
7 years ago
3 changed files with 45 additions and 2 deletions
@ -0,0 +1,15 @@ |
|||||||
|
from pyramid.security import Allow, Authenticated, Deny, Everyone |
||||||
|
|
||||||
|
from .base import BaseResource |
||||||
|
|
||||||
|
|
||||||
|
class Account(BaseResource): |
||||||
|
|
||||||
|
def __acl__(self): |
||||||
|
return [ |
||||||
|
(Allow, Everyone, 'login'), |
||||||
|
(Allow, Everyone, 'logout'), |
||||||
|
(Deny, Authenticated, 'register'), |
||||||
|
(Allow, Everyone, 'register'), |
||||||
|
(Allow, Authenticated, 'settings'), |
||||||
|
] |
@ -0,0 +1,19 @@ |
|||||||
|
from pyramid.security import DENY_ALL |
||||||
|
|
||||||
|
|
||||||
|
class BaseResource(object): |
||||||
|
|
||||||
|
__parent__ = None |
||||||
|
__name__ = None |
||||||
|
|
||||||
|
_request = None |
||||||
|
|
||||||
|
nav_highlight = None |
||||||
|
|
||||||
|
def __init__(self, name, parent): |
||||||
|
self.__name__ = name |
||||||
|
self.__parent__ = parent |
||||||
|
self._request = parent._request |
||||||
|
|
||||||
|
def __acl__(self): |
||||||
|
return [ DENY_ALL ] |
Reference in new issue