Hi, Here is a small patch for http://docs.repoze.org/bfg/current/tutorials/bfgwiki/authorization.html
Changes: - point to the groupfinder function from the zcml file - use a group in example ACL , so that there is a point to the groupfinder function - user group:groupname syntax to define the group instead of group.groupname to be consistent with what's in the narrative doc at http://docs.repoze.org/bfg/current/narr/security.html Best regards, Alex
Index: docs/tutorials/bfgwiki/src/authorization/tutorial/configure.zcml =================================================================== --- docs/tutorials/bfgwiki/src/authorization/tutorial/configure.zcml (revision 9647) +++ docs/tutorials/bfgwiki/src/authorization/tutorial/configure.zcml (working copy) @@ -12,6 +12,7 @@ <authtktauthenticationpolicy secret="sosecret" + callback=".security.groupfinder" /> <aclauthorizationpolicy/> Index: docs/tutorials/bfgwiki/src/authorization/tutorial/models.py =================================================================== --- docs/tutorials/bfgwiki/src/authorization/tutorial/models.py (revision 9647) +++ docs/tutorials/bfgwiki/src/authorization/tutorial/models.py (working copy) @@ -7,7 +7,7 @@ class Wiki(PersistentMapping): __name__ = None __parent__ = None - __acl__ = [ (Allow, Everyone, 'view'), (Allow, 'editor', 'edit') ] + __acl__ = [ (Allow, Everyone, 'view'), (Allow, 'group:editors', 'edit') ] class Page(Persistent): def __init__(self, data): Index: docs/tutorials/bfgwiki/src/authorization/tutorial/security.py =================================================================== --- docs/tutorials/bfgwiki/src/authorization/tutorial/security.py (revision 9647) +++ docs/tutorials/bfgwiki/src/authorization/tutorial/security.py (working copy) @@ -1,6 +1,6 @@ USERS = {'editor':'editor', 'viewer':'viewer'} -GROUPS = {'editor':['group.editors']} +GROUPS = {'editor':['group:editors']} def groupfinder(userid, request): if userid in USERS: Index: docs/tutorials/bfgwiki/authorization.rst =================================================================== --- docs/tutorials/bfgwiki/authorization.rst (revision 9647) +++ docs/tutorials/bfgwiki/authorization.rst (working copy) @@ -153,7 +153,7 @@ .. code-block:: python :linenos: - __acl__ = [ (Allow, Everyone, 'view'), (Allow, 'editor', 'edit') ] + __acl__ = [ (Allow, Everyone, 'view'), (Allow, 'group:editors', 'edit') ] It's only happenstance that we're assigning this ACL at class scope. An ACL can be attached to an object *instance* too; this is how "row
_______________________________________________ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev