• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 26. New Principal-Source Plug-in... > Step 4: Registering the Principal So...

Step 4: Registering the Principal Source and Creating Basic Views

You now have to register the PasswdPrincipalSource plug-in as content and create a basic add/edit form because you need to allow the user to specify a data file. You need to create a configuration file named configure.zcml and add the following directives to it:

01 <configure
02     xmlns="http://namespaces.zope.org/zope"
03     xmlns:browser="http://namespaces.zope.org/browser"
04     i18n_domain="demo_passwdauth">
05
06 <content class=".PasswdPrincipalSource">
07   <factory
08       id="zope.app.principalsources.PasswdPrincipalSource"
09       />
10   <allow interface=".interfaces.IFileBasedPrincipalSource"
11       />
12   <require
13       permission="zope.ManageContent"
14       set_schema=".interfaces.IFileBasedPrincipalSource"
15       />
16 </content>
17
18 <browser:addform
19     schema=".interfaces.IFileBasedPrincipalSource"
20     label="Add file-based Principal Source in /etc/passwd style"
21     name="AddPasswdPrincipalSourceForm.html"
22     content_factory=".PasswdPrincipalSource"
23     arguments="filename"
24     permission="zope.ManageContent"
25     />
26
27 <browser:addMenuItem
28     title="/etc/passwd Principal Source"
29     class=".PasswdPrincipalSource"
30     view="AddPasswdPrincipalSourceForm.html"
31     permission="zope.ManageServices"
32     />
33
34 <browser:editform
35     schema=".interfaces.IFileBasedPrincipalSource"
36     label="Edit file-based Principal Source"
37     name="edit.html"
38     menu="zmi_views" title="Edit"
39     permission="zope.ManageContent"
40     /> 
41 </configure>


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint