summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTres Seaver <tseaver@palladion.com>2012-12-23 20:54:13 +0000
committerTres Seaver <tseaver@palladion.com>2012-12-23 20:54:13 +0000
commit9246f482134969f880194f5579b81caa726e4109 (patch)
tree94fdf2e80b06775a82735e94a7f92ac3affc5a85 /docs
parentcfdd02d6a1bf85524c95ad3ce51800e8c594f5d9 (diff)
downloadzope-security-9246f482134969f880194f5579b81caa726e4109.tar.gz
Fold in a ZCML doctest.
Diffstat (limited to 'docs')
-rw-r--r--docs/api/zcml.rst30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/api/zcml.rst b/docs/api/zcml.rst
index dbf9179..5fdc3a0 100644
--- a/docs/api/zcml.rst
+++ b/docs/api/zcml.rst
@@ -1,6 +1,36 @@
:mod:`zope.security.zcml`
===============================
+Configuring security via ZCML
+-----------------------------
+
+:mod:`zope.security` provides a ZCML file that configures some utilities and
+a couple of permissions:
+
+.. doctest::
+
+ >>> from zope.component import getGlobalSiteManager
+ >>> from zope.configuration.xmlconfig import XMLConfig
+ >>> import zope.security
+
+ >>> XMLConfig('permissions.zcml', zope.security)()
+
+ >>> len(list(getGlobalSiteManager().registeredUtilities()))
+ 7
+
+Clear the current state:
+
+.. doctest::
+
+ >>> from zope.component.testing import setUp, tearDown
+ >>> tearDown()
+ >>> setUp()
+
+ >>> XMLConfig('configure.zcml', zope.security)()
+
+ >>> len(list(getGlobalSiteManager().registeredUtilities()))
+ 10
+
.. autoclass:: zope.security.zcml.Permission
:members:
:member-order: bysource