[Zope3-checkins] CVS: zopeproducts/zwiki - INSTALL.txt:1.3 TODO.txt:1.11 configure.zcml:1.14

Stephan Richter srichter@cbu.edu
Wed, 9 Apr 2003 12:27:28 -0400


Update of /cvs-repository/zopeproducts/zwiki
In directory cvs.zope.org:/tmp/cvs-serv27917

Modified Files:
	INSTALL.txt TODO.txt configure.zcml 
Log Message:
- Added very fine-grained security.

- Updated INSTALL.txt to reflect the changes.

- Updated TODO.txt.


=== zopeproducts/zwiki/INSTALL.txt 1.2 => 1.3 ===
--- zopeproducts/zwiki/INSTALL.txt:1.2	Wed Apr  9 11:16:39 2003
+++ zopeproducts/zwiki/INSTALL.txt	Wed Apr  9 12:27:28 2003
@@ -11,5 +11,16 @@
 
      <include package='zopeproducts.zwiki' />
 
-  - If you want restructured text support, you need to install the **CVS**
-    version of docutils, which you can retrieve from http://docutils.fs.net.
\ No newline at end of file
+  - You need to define the following role declarations to your user in order
+    to use the zwiki product effectively.
+
+     <grant role="WikiAdmin" principal="user" />
+     <grant role="WikiEditor" principal="user" />
+     <grant role="WikiUser" principal="user" />
+
+     <grant role="WikiUser" principal="anybody" />
+
+
+  - (Optional) If you want restructured text support, you need to install the
+    **CVS** version of docutils, which you can retrieve from
+    http://docutils.fs.net.


=== zopeproducts/zwiki/TODO.txt 1.10 => 1.11 ===
--- zopeproducts/zwiki/TODO.txt:1.10	Wed Apr  9 11:47:07 2003
+++ zopeproducts/zwiki/TODO.txt	Wed Apr  9 12:27:28 2003
@@ -40,11 +40,7 @@
 
     - Implement search.
 
-    - Implement better security policies, i.e. custom permissions, roles...
-
     - Implement events, so that we can have E-mail subscriptions to Wiki
       changes.
 
     - Implements E-mail subscriptions.
-
-    - Use Renderer classes to implement comment generator.
\ No newline at end of file


=== zopeproducts/zwiki/configure.zcml 1.13 => 1.14 ===
--- zopeproducts/zwiki/configure.zcml:1.13	Wed Apr  9 11:47:07 2003
+++ zopeproducts/zwiki/configure.zcml	Wed Apr  9 12:27:28 2003
@@ -4,6 +4,95 @@
    xmlns:gts="http://namespaces.zope.org/gts"
    xmlns:wiki="http://namespaces.zope.org/wiki">
 
+<!-- Security definitions -->
+
+<role
+    id="WikiUser"
+    title="Wiki User"
+    description="Someone who looks at the wiki, but can only comment on them." 
+    />
+
+<role
+    id="WikiEditor"
+    title="Wiki Editor"
+    description="The Wiki Editor can create and edit wikis." 
+    />
+
+<role
+    id="WikiAdmin"
+    title="Wiki Administrator"
+    description="The Wiki Admin can fully manage wiki pages." 
+    />
+
+<permission
+    id="zopeproducts.zwiki.ViewWikiPage"
+    title="View Wiki Page"
+    description="View a Wiki Page."
+    />
+
+<grant
+    permission="zopeproducts.zwiki.ViewWikiPage"
+    role="WikiUser"
+    />
+
+<permission
+    id="zopeproducts.zwiki.CommentWikiPage"
+    title="Comment on Wiki Page"
+    description="Make a comment on Wiki Page."
+    />
+
+<grant
+    permission="zopeproducts.zwiki.CommentWikiPage"
+    role="WikiUser"
+    />
+
+<permission
+    id="zopeproducts.zwiki.AddWikiPage"
+    title="Add Wiki Page"
+    description="Add Wiki Page."
+    />
+
+<grant
+    permission="zopeproducts.zwiki.AddWikiPage"
+    role="WikiEditor"
+    />
+
+<permission
+    id="zopeproducts.zwiki.EditWikiPage"
+    title="Edit Wiki Page"
+    description="Edit Wiki Page."
+    />
+
+<grant
+    permission="zopeproducts.zwiki.EditWikiPage"
+    role="WikiEditor"
+    />
+
+<permission
+    id="zopeproducts.zwiki.DeleteWikiPage"
+    title="Delete Wiki Page"
+    description="Delete Wiki Page."
+    />
+
+<grant
+    permission="zopeproducts.zwiki.DeleteWikiPage"
+    role="WikiAdmin"
+    />
+
+<permission
+    id="zopeproducts.zwiki.ReparentWikiPage"
+    title="Reparent Wiki Page"
+    description="Reparent a Wiki Page."
+    />
+
+<grant
+    permission="zopeproducts.zwiki.ReparentWikiPage"
+    role="WikiAdmin"
+    />
+
+
+<!-- Content declarations -->
+
   <content class=".zwiki.Wiki">
 
     <implements interface="zope.app.interfaces.container.IContentContainer" />
@@ -45,9 +134,8 @@
         title="Wiki Page"
         description="A Wiki Page" />
 
-    <!-- XXX: This security needs to be improved. -->
     <require
-        permission="zope.View"
+        permission="zopeproducts.zwiki.AddWikiPage"
         interface=".interfaces.IWikiPage"
         set_schema=".interfaces.IWikiPage" />
 
@@ -88,7 +176,7 @@
       for=".interfaces.IWiki"
       class=".browser.TableOfContents"
       template="wiki_toc.pt"
-      permission="zope.View"
+      permission="zopeproducts.zwiki.ViewWikiPage"
       menu="zmi_views"
       title="TOC"/>
 
@@ -112,7 +200,7 @@
       name="AddWikiPage"
       schema=".interfaces.IWikiPage"
       content_factory=".zwiki.WikiPage"
-      permission="zope.ManageContent"
+      permission="zopeproducts.zwiki.AddWikiPage"
       fields="source type"
       class=".browser.EditWikiPage"
       menu="add_wiki"
@@ -123,7 +211,7 @@
       for=".interfaces.IWikiPage"
       label="Change Wiki Page"
       name="edit.html"
-      permission="zope.ManageContent"
+      permission="zopeproducts.zwiki.EditWikiPage"
       fields="source type"
       class=".browser.EditWikiPage"
       menu="zmi_views" title="Edit" />
@@ -131,7 +219,7 @@
   <browser:pages
       for=".interfaces.IWikiPage"
       class=".browser.ViewWikiPage"
-      permission="zope.View">
+      permission="zopeproducts.zwiki.ViewWikiPage">
       <browser:page name="view.html" template="view_page.pt"
           menu="zmi_views" title="View" />
       <browser:page name="jumpto.html" attribute="jumpTo" />
@@ -140,7 +228,7 @@
   <browser:pages
       for=".interfaces.IWikiPage"
       class=".browser.EditWikiParents"
-      permission="zope.ManageContent">
+      permission="zopeproducts.zwiki.ReparentWikiPage">
       <browser:page name="parents.html" template="parents_page.pt"
           menu="zmi_views" title="Parents" />
       <browser:page name="setParents.html" attribute="setParents" />
@@ -149,7 +237,7 @@
   <browser:pages
       for=".interfaces.IWikiPage"
       class=".browser.WikiPageComment"
-      permission="zope.ManageContent">
+      permission="zopeproducts.zwiki.CommentWikiPage">
       <browser:page name="commentForm.html" template="comment_page.pt"
           menu="zmi_views" title="Add Comment" />
       <browser:page name="addComment.html" attribute="comment" />
@@ -182,14 +270,14 @@
    for=".interfaces.IWikiPage"
    provides="zope.app.interfaces.file.IReadFile"
    factory=".zwiki.WikiPageReadFile"
-   permission="zope.View"
+   permission="zopeproducts.zwiki.ViewWikiPage"
    />
 
 <adapter 
    for=".interfaces.IWikiPage"
    provides="zope.app.interfaces.file.IWriteFile"
    factory=".zwiki.WikiPageWriteFile"
-   permission="zope.ManageContent"
+   permission="zopeproducts.zwiki.EditWikiPage"
    />
 
 
@@ -201,7 +289,7 @@
 
 <service 
     serviceType="WikiSourceTypeRegistry"
-    permission="zope.View"
+    permission="zopeproducts.zwiki.ViewWikiPage"
     component=".sourcetype.SourceTypes" />
 
 <include file="meta.zcml" />