[Checkins] SVN: z3c.securitytool/trunk/ Adding the SecurityTool
skin to the tests and the registrations for the securitytool views
Daniel Blackburn
blackburnd at gmail.com
Tue Feb 26 20:36:59 EST 2008
Log message for revision 84295:
Adding the SecurityTool skin to the tests and the registrations for the securitytool views
Changed:
U z3c.securitytool/trunk/README.txt
U z3c.securitytool/trunk/src/z3c/securitytool/README.txt
U z3c.securitytool/trunk/src/z3c/securitytool/browser/__init__.py
U z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml
U z3c.securitytool/trunk/src/z3c/securitytool/site.zcml
-=-
Modified: z3c.securitytool/trunk/README.txt
===================================================================
--- z3c.securitytool/trunk/README.txt 2008-02-27 01:36:27 UTC (rev 84294)
+++ z3c.securitytool/trunk/README.txt 2008-02-27 01:36:58 UTC (rev 84295)
@@ -7,13 +7,6 @@
view in any context. These permissions are gathered from the roles
groups and of course directly provided permissions.
-
- THE SECURITYTOOL VIEWS ARE zope.Public RIGHT NOW. DO NOT INSTALL
- THIS ON A PRODUCTION BOX. ANYONE WILL BE ABLE TO SEE YOUR PERMISSIONS
- FOR EVERY VIEW. THESE PERMISSIONS WILL STAY THIS WAY UNTIL THE BETA
- IS ANNOUNCED. IF YOU NEED TO INSTALL IT ON A PUBLIC BOX CHANGE THE
- SETTINGS IN browser/configure.zcml TO BE MANAGER ACCESS ONLY.
-
===================================================================
Demo Instructions
===================================================================
@@ -27,13 +20,13 @@
$ ./bin/demo fg
Then access the demo site using:
- http://localhost:8080/securityMatrix.html
+ http://localhost:8080/++skin++SecurityTool/securityMatrix.html
There are some folders added with permissions and roles applied to show
the settings in the demo.
- - http://localhost:8080/Folder1/securityMatrix.html
- - http://localhost:8080/Folder1/Folder2/securityMatrix.html
+ http://localhost:8080/++skin++SecurityTool/Folder1/securityMatrix.html
+ http://localhost:8080/++skin++SecurityTool/Folder1/Folder2/securityMatrix.html
These permissions should mirror what you see in the @@grant.html views
- http://localhost:8080/Folder1/Folder2/@@grant.html
@@ -41,9 +34,3 @@
( These settings are added when the database is first opened
You can find these settings in demoSetup.py )
-
-
- If you select the ConcordTimes skin the same permissions will be
- displayed as the permissions described in README.txt functional
- test
-
Modified: z3c.securitytool/trunk/src/z3c/securitytool/README.txt
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/README.txt 2008-02-27 01:36:27 UTC (rev 84294)
+++ z3c.securitytool/trunk/src/z3c/securitytool/README.txt 2008-02-27 01:36:58 UTC (rev 84295)
@@ -18,9 +18,12 @@
1. Add the z3c.securitytool to your install_requires in your
setup.py.
2. Add the <include package="z3c.securitytool"/> to your site.zcml
- 3. Append the @@securityMatrix.html view to any context to view the permission
- matrix for that context.
+ 3. Use the skin `++skin++SecurityTool` to access securityTool pages
+ 4. Append @@securityMatrix.html view to any context to view the permission
+ matrix for that context using the security tool skin.
+ For exapmple:
+ http://localhost:8080/++skin++SecurityTool/Folder1/@@securityMatrix.html
Desired Behavior
---------------
@@ -381,39 +384,39 @@
First we will check if the main page is available
- >>> manager.open('http://localhost:8080/@@securityMatrix.html')
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/@@securityMatrix.html')
- >>> manager.open('http://localhost:8080/Folder1/@@securityMatrix.html')
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/Folder1/@@securityMatrix.html')
- >>> manager.open('http://localhost:8080/Folder1/Folder2/Folder3/@@securityMatrix.html')
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/Folder1/Folder2/Folder3/@@securityMatrix.html')
Now lets send the filter variable so our test is complete
- >>> manager.open('http://localhost:8080/@@securityMatrix.html?'
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/@@securityMatrix.html?'
... 'FILTER=None&selectedSkin=ConcordTimes')
And with the selected permission
- >>> manager.open('http://localhost:8080/@@securityMatrix.html?'
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/@@securityMatrix.html?'
... 'FILTER=None&selectedSkin=ConcordTimes&'
... 'selectedPermission=zope.Public')
Here we send an invalid selectedPermisson ( just for coverage ) ;)
- >>> manager.open('http://localhost:8080/@@securityMatrix.html?'
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/@@securityMatrix.html?'
... 'FILTER=None&selectedSkin=ConcordTimes&'
... 'selectedPermission=zope.dummy')
And with the None permission
- >>> manager.open('http://localhost:8080/@@securityMatrix.html?'
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/@@securityMatrix.html?'
... 'FILTER=None&selectedSkin=ConcordTimes&'
... 'selectedPermission=None')
This is the principal detail page, you can get to by clicking on the
principals name at the top of the form.
- >>> manager.open('http://localhost:8080/@@principalDetails.html?principal=zope.daniel')
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/@@principalDetails.html?principal=zope.daniel')
- >>> manager.open('http://localhost:8080/Folder1/Folder2/Folder3/@@principalDetails.html?principal=zope.daniel')
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/Folder1/Folder2/Folder3/@@principalDetails.html?principal=zope.daniel')
>>> 'Permission settings' in manager.contents
@@ -421,31 +424,31 @@
And lets call the view without a principal
- >>> manager.open('http://localhost:8080/@@principalDetails.html')
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/@@principalDetails.html')
Traceback (most recent call last):
...
PrincipalLookupError: no principal specified
Here is the view you will see if you click on the actual permission
value in the matrix intersecting the view to the user on a public view.
- >>> manager.open('http://localhost:8080/@@permissionDetails.html?'
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/@@permissionDetails.html?'
... 'principal=zope.daniel&view=PUT')
'zope.Public' in manager.contents
True
Ok lets send the command without the principal:
- >>> manager.open('http://localhost:8080/@@permissionDetails.html?view=PUT')
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/@@permissionDetails.html?view=PUT')
Traceback (most recent call last):
...
PrincipalLookupError: no user specified
And now we will test it without the view name
- >>> manager.open('http://localhost:8080/@@permissionDetails.html?principal=zope.daniel')
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/@@permissionDetails.html?principal=zope.daniel')
And now with a view name that does not exist
- >>> manager.open('http://localhost:8080/@@permissionDetails.html?principal=zope.daniel&view=garbage')
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/@@permissionDetails.html?principal=zope.daniel&view=garbage')
Lets also test with a different context level
- >>> manager.open('http://localhost:8080/Folder1/Folder2/Folder3/@@permissionDetails.html?principal=zope.daniel&view=ReadIssue.html')
+ >>> manager.open('http://localhost:8080/++skin++SecurityTool/Folder1/Folder2/Folder3/@@permissionDetails.html?principal=zope.daniel&view=ReadIssue.html')
Modified: z3c.securitytool/trunk/src/z3c/securitytool/browser/__init__.py
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/browser/__init__.py 2008-02-27 01:36:27 UTC (rev 84294)
+++ z3c.securitytool/trunk/src/z3c/securitytool/browser/__init__.py 2008-02-27 01:36:58 UTC (rev 84295)
@@ -4,4 +4,7 @@
class IConcordTimesSkin(minimal.IMinimalBrowserLayer):
"""The IConcordTimes skin for testing Securitytool."""
+class ISecurityToolSkin(minimal.IMinimalBrowserLayer):
+ """The SecurityTool skin for using Securitytool."""
+
Modified: z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml 2008-02-27 01:36:27 UTC (rev 84294)
+++ z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml 2008-02-27 01:36:58 UTC (rev 84295)
@@ -57,6 +57,12 @@
<include package="z3c.securitytool" file="concordTimesPrincipals.zcml"/>
<include package="z3c.securitytool" file="concordTimesDummyViews.zcml"/>
+ <interface
+ interface="z3c.securitytool.browser.ISecurityToolSkin"
+ type="zope.publisher.interfaces.browser.IBrowserSkinType"
+ name="SecurityTool"
+ />
+
<browser:defaultView for="*" name="securityMatrix.html"/>
</configure>
Modified: z3c.securitytool/trunk/src/z3c/securitytool/site.zcml
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/site.zcml 2008-02-27 01:36:27 UTC (rev 84294)
+++ z3c.securitytool/trunk/src/z3c/securitytool/site.zcml 2008-02-27 01:36:58 UTC (rev 84295)
@@ -16,15 +16,20 @@
<include package="z3c.macro" file="meta.zcml" />
<include package="z3c.layer.minimal" />
-
<securityPolicy
component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
-
<include package="z3c.securitytool"/>
<include package="z3c.securitytool" file="concordTimesPrincipals.zcml"/>
<include package="z3c.securitytool" file="concordTimesDummyViews.zcml"/>
+ <interface
+ interface="z3c.securitytool.browser.ISecurityToolSkin"
+ type="zope.publisher.interfaces.browser.IBrowserSkinType"
+ name="SecurityTool"
+ />
+
+
<browser:defaultView for="*" name="securityMatrix.html"/>
</configure>
More information about the Checkins
mailing list