[Checkins] SVN: z3c.securitytool/trunk/src/z3c/securitytool/ 

Daniel Blackburn blackburnd at gmail.com
Fri Dec 7 11:08:23 EST 2007


Log message for revision 82188:
  
  

Changed:
  U   z3c.securitytool/trunk/src/z3c/securitytool/README.txt
  U   z3c.securitytool/trunk/src/z3c/securitytool/browser/views.py
  U   z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml

-=-
Modified: z3c.securitytool/trunk/src/z3c/securitytool/README.txt
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/README.txt	2007-12-07 15:46:42 UTC (rev 82187)
+++ z3c.securitytool/trunk/src/z3c/securitytool/README.txt	2007-12-07 16:08:23 UTC (rev 82188)
@@ -150,21 +150,24 @@
   >>> daniel_part = testing.Participation(daniel)
   >>> daniel_policy.add(daniel_part)
   
-To allow editors to create articles Martin has to create a new Issue:
-     
+
   >>> firstIssue = \
   ...    Folder()
-
-
   >>> concordTimes['firstIssue'] = firstIssue
   >>> concordTimes._p_changed = 1
   >>> transaction.commit()
 
+
+
 Randy starts to write his first article:
     
   >>> firstArticle = Article('A new star is born',
   ...                        'A new star is born, the `The Concord Times` ...')
   
+   TODO: add permisson settings for this context then test with
+   functional tests.
+
+
   
 Markus tries to give his fellow writer some help by attempting to
 create an Issue and of course cannot.
@@ -182,7 +185,7 @@
 This is not yet complete. But this is the proper way to connect.
 Now lets see if the app displays the appropriate permissions.
 
-    >>> from zope.testbrowser.browser import Browser # use for external
+    >>> from zope.testbrowser.testing import Browser # use for external
     >>> import base64
     >>> manager = Browser()
     >>> login,password = 'admin','admin'
@@ -192,6 +195,51 @@
     >>> manager.addHeader('Authorization', authHeader)
     >>> manager.handleErrors = False
 
-    >>> #manager.open('http://localhost:8080/vum.html')
+    >>> list(concordTimes.keys())
+    [u'firstIssue']
 
 
+Our issue was added to the root folder as we can see by printing @@contents.html
+    >>> manager.open('http://localhost:8080/@@contents.html')
+    >>> print manager.contents
+    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+    <BLANKLINE>
+    ...
+    <td>
+      <input type="checkbox"
+             class="noborder slaveBox"
+             name="ids:list" id="firstIssue"
+             value="firstIssue" />
+    </td>
+    ...
+    </html>
+    <BLANKLINE>
+    <BLANKLINE>
+
+
+TODO: Make this a real test.
+    >>> manager.open('http://localhost:8080/@@vum.html')
+    >>> print manager.contents
+    <html>
+    <head>
+    <link type="text/css" rel="stylesheet" media="all"
+    ...
+    </body>
+    </html>
+    <BLANKLINE>
+
+
+TODO: make this a valid test we are looking for permission
+settings provided in the test appear on the html page.
+
+    >>> manager.open('http://localhost:8080/firstIssue/pd.html?principal='
+    ... + 'zope.sample_manager&view=addSiteManager.html"')
+
+    >>> print manager.contents
+    <html>
+    <head>
+    ...
+    </html>
+    <BLANKLINE>
+
+

Modified: z3c.securitytool/trunk/src/z3c/securitytool/browser/views.py
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/browser/views.py	2007-12-07 15:46:42 UTC (rev 82187)
+++ z3c.securitytool/trunk/src/z3c/securitytool/browser/views.py	2007-12-07 16:08:23 UTC (rev 82188)
@@ -7,10 +7,10 @@
 import urllib
 
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
-from zope.app.securitypolicy.zopepolicy import settingsForObject
+from z3c.securitytool.securitytool import settingsForObject
 from zope.security.proxy import removeSecurityProxy
 from zope.interface import providedBy
-from zope.app.session.interfaces import ISession
+from zope.session.interfaces import ISession
 from zope.app import zapi
 
 from z3c.securitytool.interfaces import ISecurityChecker

Modified: z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml	2007-12-07 15:46:42 UTC (rev 82187)
+++ z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml	2007-12-07 16:08:23 UTC (rev 82188)
@@ -24,9 +24,6 @@
     component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
 
   <role id="zope.Anonymous" title="Everybody" />
-  <role id="zope.role1" title="Role 1" />
-  <role id="zope.role2" title="Role 2" />
-
   <role id="zope.Manager" title="Manager" />
 
   <unauthenticatedPrincipal
@@ -46,35 +43,11 @@
     password="admin"
     />
 
-  <principal
-    id="zope.user_1"
-    title="Sample User1"
-    login="user1"
-    password="user1"
-    />
-
-  <principal
-    id="zope.user_2"
-    title="Sample User2"
-    login="user2"
-    password="user2"
-    />
-
   <grant
     role="zope.Manager"
     principal="zope.sample_manager"
     />
 
-  <grant
-    role="zope.role1"
-    principal="zope.user_1"
-    />
-
-  <grant
-    role="zope.role2"
-    principal="zope.user_2"
-    />
-
   <grantAll role="zope.Manager" />
 
 



More information about the Checkins mailing list