is a sequence of ACE tuples - ACE : Access control entry a three-tuple that describes three things: an action (Allow or Deny), a principal (a string describing a user or group), and a permission __acl__ = [ (Allow, 'fred', 'view'), (Allow, 'henry', 'view') ] (Allow, 'fred', 'view') Wednesday, 1 January 14
its parent, its parent’s parent, and so on. If part of a lineage, the context’s parents are consulted for the ACL information too. Wednesday, 1 January 14
the resource instance if you need instance- level security, or it can be defined on the resource class if you just need type- level security. Wednesday, 1 January 14
[ (Allow, 'jack', 'view')] class Billing(object): def __init__(self, request): matchdict = request.matchdict self.id = matchdict.get('id', None) if self.id == '1': self.__acl__ = [ (Allow, 'henry', 'view'), (Allow, 'jack', 'view') ] On the class On the instance Wednesday, 1 January 14
ACL when it is the context, its parent is consulted for an ACL. class Repo(Base): __acl__ = [ (Allow, 'jack', 'view') ] class Wiki(Base): __name__ = 'wiki' __parent__ = Repo Wednesday, 1 January 14
from pyramid.authorization import ACLAuthorizationPolicy from pyramid.view import view_config from pyramid.security import Allow, remember, forget from pyramid.security import authenticated_userid from pyramid.httpexceptions import HTTPFound Wednesday, 1 January 14
from pyramid.authorization import ACLAuthorizationPolicy from pyramid.view import view_config from pyramid.security import Allow, remember, forget from pyramid.security import authenticated_userid from pyramid.httpexceptions import HTTPFound Wednesday, 1 January 14