[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/pluggableauth - __init__.py:1.2 configure.zcml:1.2
Chris McDonough
chrism@zope.com
Mon, 23 Jun 2003 18:46:44 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/services/pluggableauth
In directory cvs.zope.org:/tmp/cvs-serv30079/src/zope/app/browser/services/pluggableauth
Added Files:
__init__.py configure.zcml
Log Message:
Merge pluggable_authentication_service-branch to HEAD.
You can now use a pluggable authentication service in place of a simple authentication service.
=== Zope3/src/zope/app/browser/services/pluggableauth/__init__.py 1.1 => 1.2 ===
--- /dev/null Mon Jun 23 18:46:44 2003
+++ Zope3/src/zope/app/browser/services/pluggableauth/__init__.py Mon Jun 23 18:46:14 2003
@@ -0,0 +1,17 @@
+# For Views
+
+from zope.app.browser.services.service import Adding
+from zope.context import ContextSuper
+from zope.app.interfaces.services.pluggableauth import IReadPrincipalSource
+
+class PrincipalSourceAdding(Adding):
+ """Adding subclass used for principal sources."""
+
+ menu_id = "add_principal_source"
+
+ def add(self, content):
+
+ if not IReadPrincipalSource.isImplementedBy(content):
+ raise TypeError("%s is not a readable principal source" % content)
+
+ return ContextSuper(PrincipalSourceAdding, self).add(content)
=== Zope3/src/zope/app/browser/services/pluggableauth/configure.zcml 1.1 => 1.2 ===
--- /dev/null Mon Jun 23 18:46:44 2003
+++ Zope3/src/zope/app/browser/services/pluggableauth/configure.zcml Mon Jun 23 18:46:14 2003
@@ -0,0 +1,86 @@
+<zopeConfigure xmlns="http://namespaces.zope.org/browser"
+ xmlns:global_translation="http://namespaces.zope.org/gts">
+
+<!-- Pluggable Authentication Service -->
+
+<menuItem
+ menu="add_service"
+ for="zope.app.interfaces.container.IAdding"
+ action="zope.app.services.PluggableAuthenticationService"
+ title="Pluggable Authentication Service"
+ description="A Pluggable Authentication Service"
+ />
+
+<page
+ name="contents.html"
+ for="zope.app.services.pluggableauth.IPluggableAuthenticationService"
+ permission="zope.ManageServices"
+ class="zope.app.browser.container.contents.Contents"
+ attribute="contents"
+ />
+
+<view
+ name="+"
+ menu="zmi_actions" title="Add Source"
+ for="zope.app.services.pluggableauth.IPluggableAuthenticationService"
+ permission="zope.ManageContent"
+ class="zope.app.browser.services.pluggableauth.PrincipalSourceAdding" >
+
+ <page name="index.html" attribute="index"/>
+ <page name="action.html" attribute="action"/>
+
+</view>
+
+<menu id="add_principal_source"
+ title="Menu for adding new PrincipalSource."/>
+
+<!-- Principal Source -->
+
+<menuItem
+ menu="add_principal_source"
+ for="zope.app.interfaces.container.IAdding"
+ action="zope.app.principalsources.BTreePrincipalSource"
+ title="BTree Principal Source"
+ description="BTree Principal Source"
+ />
+
+<page
+ name="contents.html"
+ for="zope.app.services.pluggableauth.IPrincipalSource"
+ permission="zope.ManageServices"
+ class="zope.app.browser.container.contents.Contents"
+ attribute="contents"
+ />
+
+<view
+ name="+"
+ for="zope.app.services.pluggableauth.IPrincipalSource"
+ permission="zope.ManageContent"
+ class="zope.app.browser.container.adding.Adding"/>
+
+<menuItem
+ menu="zmi_actions" title="Add Principal"
+ for="zope.app.services.pluggableauth.IPrincipalSource"
+ action="+/AddPrincipalForm"
+ />
+
+<addform
+ schema="zope.app.interfaces.services.pluggableauth.IUserSchemafied"
+ label="Add Simple User with details"
+ content_factory="zope.app.services.pluggableauth.SimplePrincipal"
+ arguments="login password title description"
+ fields="login password title description"
+ name="AddPrincipalForm"
+ permission="zope.ManageContent" />
+
+<editform
+ schema="zope.app.interfaces.services.pluggableauth.IUserSchemafied"
+ label="Edit User Information"
+ fields="login password title description"
+ name="edit.html"
+ menu="zmi_views" title="Edit"
+ permission="zope.ManageContent" />
+
+<!-- Principals -->
+
+</zopeConfigure>
\ No newline at end of file