From 216f1b635b616af61a63ba92ed15e4e950eaf407 Mon Sep 17 00:00:00 2001
From: Fabien Morin <fabien@nexedi.com>
Date: Tue, 29 Sep 2009 12:52:54 +0000
Subject: [PATCH] update class permission to use existing ones

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29297 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../DocumentTemplateItem/ApparelAssortment.py            | 2 +-
 bt5/erp5_apparel/DocumentTemplateItem/ApparelCloth.py    | 2 +-
 .../DocumentTemplateItem/ApparelColourRange.py           | 2 +-
 .../DocumentTemplateItem/ApparelComponent.py             | 2 +-
 bt5/erp5_apparel/DocumentTemplateItem/ApparelFabric.py   | 2 +-
 .../DocumentTemplateItem/ApparelMeasurement.py           | 9 +++++----
 bt5/erp5_apparel/DocumentTemplateItem/ApparelModel.py    | 2 +-
 bt5/erp5_apparel/DocumentTemplateItem/ApparelShape.py    | 2 +-
 bt5/erp5_apparel/DocumentTemplateItem/ApparelSize.py     | 4 +++-
 bt5/erp5_apparel/bt/revision                             | 2 +-
 10 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/bt5/erp5_apparel/DocumentTemplateItem/ApparelAssortment.py b/bt5/erp5_apparel/DocumentTemplateItem/ApparelAssortment.py
index 3f2765b4ad..9674afb756 100644
--- a/bt5/erp5_apparel/DocumentTemplateItem/ApparelAssortment.py
+++ b/bt5/erp5_apparel/DocumentTemplateItem/ApparelAssortment.py
@@ -47,7 +47,7 @@ class ApparelAssortment(Resource, XMLMatrix):
 
     # Declarative security
     security = ClassSecurityInfo()
-    security.declareObjectProtected(Permissions.View)
+    security.declareObjectProtected(Permissions.AccessContentsInformation)
 
     # Declarative properties
     property_sheets = ( PropertySheet.Base
diff --git a/bt5/erp5_apparel/DocumentTemplateItem/ApparelCloth.py b/bt5/erp5_apparel/DocumentTemplateItem/ApparelCloth.py
index e56b42c99b..c46f4e9fe0 100644
--- a/bt5/erp5_apparel/DocumentTemplateItem/ApparelCloth.py
+++ b/bt5/erp5_apparel/DocumentTemplateItem/ApparelCloth.py
@@ -47,7 +47,7 @@ class ApparelCloth(Resource, XMLMatrix):
 
     # Declarative security
     security = ClassSecurityInfo()
-    security.declareObjectProtected(Permissions.View)
+    security.declareObjectProtected(Permissions.AccessContentsInformation)
 
     # Declarative properties
     property_sheets = ( PropertySheet.Base
diff --git a/bt5/erp5_apparel/DocumentTemplateItem/ApparelColourRange.py b/bt5/erp5_apparel/DocumentTemplateItem/ApparelColourRange.py
index 646e88e483..08e5b89635 100644
--- a/bt5/erp5_apparel/DocumentTemplateItem/ApparelColourRange.py
+++ b/bt5/erp5_apparel/DocumentTemplateItem/ApparelColourRange.py
@@ -46,7 +46,7 @@ class ApparelColourRange(Resource):
 
     # Declarative security
     security = ClassSecurityInfo()
-    security.declareObjectProtected(Permissions.View)
+    security.declareObjectProtected(Permissions.AccessContentsInformation)
 
     # Declarative properties
     property_sheets = ( PropertySheet.Base
diff --git a/bt5/erp5_apparel/DocumentTemplateItem/ApparelComponent.py b/bt5/erp5_apparel/DocumentTemplateItem/ApparelComponent.py
index 7946f3d97a..09f15d9197 100644
--- a/bt5/erp5_apparel/DocumentTemplateItem/ApparelComponent.py
+++ b/bt5/erp5_apparel/DocumentTemplateItem/ApparelComponent.py
@@ -43,7 +43,7 @@ class ApparelComponent(Resource):
 
     # Declarative security
     security = ClassSecurityInfo()
-    security.declareObjectProtected(Permissions.View)
+    security.declareObjectProtected(Permissions.AccessContentsInformation)
 
     # Declarative properties
     property_sheets = ( PropertySheet.Base
diff --git a/bt5/erp5_apparel/DocumentTemplateItem/ApparelFabric.py b/bt5/erp5_apparel/DocumentTemplateItem/ApparelFabric.py
index 6dc11fc82c..90baaea87c 100644
--- a/bt5/erp5_apparel/DocumentTemplateItem/ApparelFabric.py
+++ b/bt5/erp5_apparel/DocumentTemplateItem/ApparelFabric.py
@@ -43,7 +43,7 @@ class ApparelFabric(Resource):
 
     # Declarative security
     security = ClassSecurityInfo()
-    security.declareObjectProtected(Permissions.View)
+    security.declareObjectProtected(Permissions.AccessContentsInformation)
 
     # Declarative properties
     property_sheets = ( PropertySheet.Base
diff --git a/bt5/erp5_apparel/DocumentTemplateItem/ApparelMeasurement.py b/bt5/erp5_apparel/DocumentTemplateItem/ApparelMeasurement.py
index ee2a57d6aa..2ea3f9b4af 100644
--- a/bt5/erp5_apparel/DocumentTemplateItem/ApparelMeasurement.py
+++ b/bt5/erp5_apparel/DocumentTemplateItem/ApparelMeasurement.py
@@ -47,7 +47,7 @@ class ApparelMeasurement(XMLObject, XMLMatrix, Image):
 
     # Declarative security
     security = ClassSecurityInfo()
-    security.declareObjectProtected(Permissions.View)
+    security.declareObjectProtected(Permissions.AccessContentsInformation)
 
     # Declarative properties
     property_sheets = ( PropertySheet.Base
@@ -65,13 +65,14 @@ class ApparelMeasurement(XMLObject, XMLMatrix, Image):
 
     # Inheritance
     _edit = Image._edit
-    security.declareProtected( Permissions.ModifyPortalContent, 'edit' )
+    security.declareProtected(Permissions.ModifyPortalContent, 'edit' )
     edit = WorkflowAction( _edit )
 
-    security.declareProtected('View', 'index_html')
+    security.declareProtected(Permissions.View,  'index_html')
     index_html = Image.index_html
 
-    security.declareProtected('AccessContentsInformation', 'content_type')
+    security.declareProtected(Permissions.AccessContentsInformation,
+                              'content_type')
     content_type = Image.content_type
 
     def manage_afterClone(self, item):
diff --git a/bt5/erp5_apparel/DocumentTemplateItem/ApparelModel.py b/bt5/erp5_apparel/DocumentTemplateItem/ApparelModel.py
index 02404a0d71..a1cdf8e69c 100644
--- a/bt5/erp5_apparel/DocumentTemplateItem/ApparelModel.py
+++ b/bt5/erp5_apparel/DocumentTemplateItem/ApparelModel.py
@@ -44,7 +44,7 @@ class ApparelModel(Resource, XMLMatrix):
 
     # Declarative security
     security = ClassSecurityInfo()
-    security.declareObjectProtected(Permissions.View)
+    security.declareObjectProtected(Permissions.AccessContentsInformation)
 
     # Declarative properties
     property_sheets = ( PropertySheet.Base
diff --git a/bt5/erp5_apparel/DocumentTemplateItem/ApparelShape.py b/bt5/erp5_apparel/DocumentTemplateItem/ApparelShape.py
index b311b40b04..95c114b02c 100644
--- a/bt5/erp5_apparel/DocumentTemplateItem/ApparelShape.py
+++ b/bt5/erp5_apparel/DocumentTemplateItem/ApparelShape.py
@@ -43,7 +43,7 @@ class ApparelShape(Resource):
 
     # Declarative security
     security = ClassSecurityInfo()
-    security.declareObjectProtected(Permissions.View)
+    security.declareObjectProtected(Permissions.AccessContentsInformation)
 
     # Declarative properties
     property_sheets = ( PropertySheet.Base
diff --git a/bt5/erp5_apparel/DocumentTemplateItem/ApparelSize.py b/bt5/erp5_apparel/DocumentTemplateItem/ApparelSize.py
index 5a82128bb3..42b55986a7 100644
--- a/bt5/erp5_apparel/DocumentTemplateItem/ApparelSize.py
+++ b/bt5/erp5_apparel/DocumentTemplateItem/ApparelSize.py
@@ -47,7 +47,7 @@ class ApparelSize(XMLObject, XMLMatrix):
 
     # Declarative security
     security = ClassSecurityInfo()
-    security.declareObjectProtected(Permissions.View)
+    security.declareObjectProtected(Permissions.AccessContentsInformation)
 
     # Declarative properties
     property_sheets = ( PropertySheet.Base
@@ -59,6 +59,7 @@ class ApparelSize(XMLObject, XMLMatrix):
                       , PropertySheet.ApparelSize
                       )
 
+    # XXX this should be done using an interraction workflow
     security.declareProtected(Permissions.ModifyPortalContent, '_updateMatrixCellRange')
     def _updateMatrixCellRange(self):
       lines = self.ApparelSize_asCellRange()[0]
@@ -69,6 +70,7 @@ class ApparelSize(XMLObject, XMLMatrix):
       else:
         self.setCellRange(lines, base_id='size')
 
+    # XXX this should be done using an interraction workflow
     security.declareProtected(Permissions.ModifyPortalContent, '_setSizeList')
     def _setSizeList(self,value):
       self._categorySetSizeList(value)
diff --git a/bt5/erp5_apparel/bt/revision b/bt5/erp5_apparel/bt/revision
index 7c091989d0..c24b6ae77d 100644
--- a/bt5/erp5_apparel/bt/revision
+++ b/bt5/erp5_apparel/bt/revision
@@ -1 +1 @@
-37
\ No newline at end of file
+38
\ No newline at end of file
-- 
2.30.9