Log message for revision 122075:
  Removed special code to create user folders and page templates while creating 
new `OFS.Folder` instances.
  

Changed:
  U   Zope/trunk/doc/CHANGES.rst
  U   Zope/trunk/src/OFS/Folder.py
  U   Zope/trunk/src/OFS/OrderedFolder.py
  U   Zope/trunk/src/OFS/dtml/addOrderedFolder.dtml
  U   Zope/trunk/src/OFS/dtml/folderAdd.dtml

-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst  2011-07-03 13:15:22 UTC (rev 122074)
+++ Zope/trunk/doc/CHANGES.rst  2011-07-03 13:17:35 UTC (rev 122075)
@@ -41,6 +41,9 @@
 Restructuring
 +++++++++++++
 
+- Removed special code to create user folders and page templates while creating
+  new `OFS.Folder` instances.
+
 - Removed persistent default code like the `error_log` and `temp_folder`.
 
 - Removed persistent default content, including the `standard_error_message`

Modified: Zope/trunk/src/OFS/Folder.py
===================================================================
--- Zope/trunk/src/OFS/Folder.py        2011-07-03 13:15:22 UTC (rev 122074)
+++ Zope/trunk/src/OFS/Folder.py        2011-07-03 13:17:35 UTC (rev 122075)
@@ -16,10 +16,6 @@
 """
 
 from AccessControl.class_init import InitializeClass
-from AccessControl.Permissions import add_page_templates
-from AccessControl.Permissions import add_user_folders
-from AccessControl.SecurityManagement import getSecurityManager
-from AccessControl.unauthorized import Unauthorized
 from App.special_dtml import DTMLFile
 from webdav.Collection import Collection
 from zope.interface import implements
@@ -39,33 +35,11 @@
                      createUserF=0,
                      REQUEST=None):
     """Add a new Folder object with id *id*.
-
-    If the 'createPublic' and 'createUserF' parameters are set to any true
-    value, an 'index_html' and a 'UserFolder' objects are created respectively
-    in the new folder.
     """
     ob = Folder(id)
     ob.title = title
     self._setObject(id, ob)
     ob = self._getOb(id)
-
-    checkPermission=getSecurityManager().checkPermission
-
-    if createUserF:
-        if not checkPermission(add_user_folders, ob):
-            raise Unauthorized, (
-                  'You are not authorized to add User Folders.'
-                  )
-        ob.manage_addUserFolder()
-
-    if createPublic:
-        if not checkPermission(add_page_templates, ob):
-            raise Unauthorized, (
-                  'You are not authorized to add Page Templates.'
-                  )
-        ob.manage_addProduct['PageTemplates'].manage_addPageTemplate(
-            id='index_html', title='')
-
     if REQUEST is not None:
         return self.manage_main(self, REQUEST, update_menu=1)
 

Modified: Zope/trunk/src/OFS/OrderedFolder.py
===================================================================
--- Zope/trunk/src/OFS/OrderedFolder.py 2011-07-03 13:15:22 UTC (rev 122074)
+++ Zope/trunk/src/OFS/OrderedFolder.py 2011-07-03 13:17:35 UTC (rev 122075)
@@ -13,10 +13,6 @@
 """ 'Folder' with order support.
 """
 
-from AccessControl.SecurityManagement import getSecurityManager
-from AccessControl.unauthorized import Unauthorized
-from AccessControl.Permissions import add_page_templates
-from AccessControl.Permissions import add_user_folders
 from App.special_dtml import DTMLFile
 from zope.interface import implements
 
@@ -29,33 +25,11 @@
 def manage_addOrderedFolder(self, id, title='', createPublic=0, createUserF=0,
                             REQUEST=None):
     """Add a new ordered Folder object with id *id*.
-
-    If the 'createPublic' and 'createUserF' parameters are set to any true
-    value, an 'index_html' and a 'UserFolder' objects are created respectively
-    in the new folder.
     """
     ob = OrderedFolder(id)
     ob.title = title
     self._setObject(id, ob)
     ob = self._getOb(id)
-
-    checkPermission = getSecurityManager().checkPermission
-
-    if createUserF:
-        if not checkPermission(add_user_folders, ob):
-            raise Unauthorized, (
-                  'You are not authorized to add User Folders.'
-                  )
-        ob.manage_addUserFolder()
-
-    if createPublic:
-        if not checkPermission(add_page_templates, ob):
-            raise Unauthorized, (
-                  'You are not authorized to add Page Templates.'
-                  )
-        ob.manage_addProduct['PageTemplates'].manage_addPageTemplate(
-            id='index_html', title='')
-
     if REQUEST:
         return self.manage_main(self, REQUEST, update_menu=1)
 

Modified: Zope/trunk/src/OFS/dtml/addOrderedFolder.dtml
===================================================================
--- Zope/trunk/src/OFS/dtml/addOrderedFolder.dtml       2011-07-03 13:15:22 UTC 
(rev 122074)
+++ Zope/trunk/src/OFS/dtml/addOrderedFolder.dtml       2011-07-03 13:17:35 UTC 
(rev 122075)
@@ -36,40 +36,11 @@
     <input type="text" name="title" size="40" />
     </td>
   </tr>
-<dtml-if 
- "_.SecurityCheckPermission('Add Documents, Images, and Files',this())">
-  <tr>
-    <td align="left" valign="top">
-    </td>
-    <td align="left" valign="top">
-    <div class="form-text">
-    <input type="checkbox" name="createPublic:int" value="1" 
-     id="cbCreatePublic"> 
-     <label for="cbCreatePublic">Create public interface</label>
-    </div>
-    </td>
-  </tr>
-</dtml-if>
 
-<dtml-if 
- "_.SecurityCheckPermission('Add User Folders',this())">
   <tr>
     <td align="left" valign="top">
     </td>
     <td align="left" valign="top">
-    <div class="form-text">
-    <input type="checkbox" name="createUserF:int" value="1" 
-     id="cbCreateUserF"> 
-     <label for="cbCreateUserF">Create user folder</label>
-    </div>
-    </td>
-  </tr>
-</dtml-if>
-
-  <tr>
-    <td align="left" valign="top">
-    </td>
-    <td align="left" valign="top">
     <div class="form-element">
     <input class="form-element" type="submit" name="submit" 
      value="Add" /> 

Modified: Zope/trunk/src/OFS/dtml/folderAdd.dtml
===================================================================
--- Zope/trunk/src/OFS/dtml/folderAdd.dtml      2011-07-03 13:15:22 UTC (rev 
122074)
+++ Zope/trunk/src/OFS/dtml/folderAdd.dtml      2011-07-03 13:17:35 UTC (rev 
122075)
@@ -36,40 +36,11 @@
     <input type="text" name="title" size="40" />
     </td>
   </tr>
-<dtml-if 
- "_.SecurityCheckPermission('Add Documents, Images, and Files',this())">
-  <tr>
-    <td align="left" valign="top">
-    </td>
-    <td align="left" valign="top">
-    <div class="form-text">
-    <input type="checkbox" name="createPublic:int" value="1" 
-     id="cbCreatePublic"> 
-     <label for="cbCreatePublic">Create public interface</label>
-    </div>
-    </td>
-  </tr>
-</dtml-if>
 
-<dtml-if 
- "_.SecurityCheckPermission('Add User Folders',this())">
   <tr>
     <td align="left" valign="top">
     </td>
     <td align="left" valign="top">
-    <div class="form-text">
-    <input type="checkbox" name="createUserF:int" value="1" 
-     id="cbCreateUserF"> 
-     <label for="cbCreateUserF">Create user folder</label>
-    </div>
-    </td>
-  </tr>
-</dtml-if>
-
-  <tr>
-    <td align="left" valign="top">
-    </td>
-    <td align="left" valign="top">
     <div class="form-element">
     <input class="form-element" type="submit" name="submit" 
      value="Add" /> 

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
https://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to