[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/Image - Image.py:1.1.2.5 image.zcml:1.1.2.4

Gary Poster garyposter@earthlink.net
Thu, 2 May 2002 13:18:18 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/Image
In directory cvs.zope.org:/tmp/cvs-serv28126/lib/python/Zope/App/OFS/Content/Image

Modified Files:
      Tag: Zope-3x-branch
	Image.py image.zcml 
Log Message:
Several interfaces divided up into readers (getters) and writers (setters), then used in the zcml for permissions.  Some small changes in the local ServiceManager to deal with the new security a bit better, hopefully.  Fixed Image enough so that you can upload one, but I'm getting a server buffer error when I try to view it.  The change to ZMIViewUtility I'm not sure of, but it made sense to me.

You can now add, edit, and view significantly more of the content since the security changes.



=== Zope3/lib/python/Zope/App/OFS/Content/Image/Image.py 1.1.2.4 => 1.1.2.5 ===
 from Zope.App.OFS.Memento.IAttributeMementoStorable \
      import IAttributeMementoStorable
+from StringIO import StringIO
 
 
 class IImage(IFile):


=== Zope3/lib/python/Zope/App/OFS/Content/Image/image.zcml 1.1.2.3 => 1.1.2.4 ===
   <zmi:factoryFromClass name="Image"
                         class=".Image."
-                        permission_id="Zope.AddImages"
+                        permission_id="Zope.ManageContent"
                         title="Image"
                         description="An Image" />
 
   <security:protectClass name=".Image."
-    interface=".Image.IImage."
-    permission_id="Zope.View" />
-
+    permission_id="Zope.View" >
+    <security:protect
+              interface="Zope.App.OFS.Content.File.IFile.IReadFile"
+              permission_id="Zope.View" />
+    <security:protect
+              interface="Zope.App.OFS.Content.Image.Image.IImage"
+              permission_id="Zope.View" />
+    <security:protect
+              interface="Zope.App.OFS.Content.File.IFile.IWriteFile"
+              permission_id="Zope.ManageContent" />
+  </security:protectClass>
 
   <!-- tabs for image -->
 
   <zmi:tabs for=".Image.IImage.">
-    <zmi:tab label="Edit" action="edit;view"/>
+    <zmi:tab label="Edit" action="edit;view"/>
+    <zmi:tab label="View" action=""/>
     <zmi:tab label="Role Permissions" action="RolePermissionsManagement;view"/>
   </zmi:tabs>