Commit 448c7766 authored by Jérome Perrin's avatar Jérome Perrin

all this have to be protected with access, not view


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44348 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b1e89c7e
......@@ -223,7 +223,7 @@ class Alarm(XMLObject, PeriodicityMixin):
# a new cache plugin which uses ZODB to store values
# for a long time.
security.declareProtected(Permissions.View, 'report')
security.declareProtected(Permissions.AccessContentsInformation, 'report')
def report(self, reset=0, process=None):
"""
This methods produces a report (HTML) to display
......
......@@ -101,7 +101,7 @@ class Container(Movement, XMLObject):
"""
return 0
security.declareProtected(Permissions.View, 'isDivergent')
security.declareProtected(Permissions.AccessContentsInformation, 'isDivergent')
def isDivergent(self):
"""
Returns 1 if the target is not met according to the current information
......
......@@ -70,7 +70,7 @@ class ContainerCell(DeliveryCell):
# Never accountable
return 0
security.declareProtected(Permissions.View, 'isDivergent')
security.declareProtected(Permissions.AccessContentsInformation, 'isDivergent')
def isDivergent(self):
"""
Returns 1 if the target is not met according to the current information
......
......@@ -79,7 +79,7 @@ class ContainerLine(DeliveryLine):
# Never accountable
return 0
security.declareProtected(Permissions.View, 'isDivergent')
security.declareProtected(Permissions.AccessContentsInformation, 'isDivergent')
def isDivergent(self):
"""
Returns 1 if the target is not met according to the current information
......
......@@ -324,14 +324,14 @@ class Delivery(XMLObject, ImmobilisationDelivery,
#######################################################
# Causality computation
security.declareProtected(Permissions.View, 'isConvergent')
security.declareProtected(Permissions.AccessContentsInformation, 'isConvergent')
def isConvergent(self,**kw):
"""
Returns 0 if the target is not met
"""
return int(not self.isDivergent(**kw))
security.declareProtected(Permissions.View, 'isSimulated')
security.declareProtected(Permissions.AccessContentsInformation, 'isSimulated')
def isSimulated(self):
"""
Returns 1 if all movements have a delivery or order counterpart
......@@ -348,7 +348,7 @@ class Delivery(XMLObject, ImmobilisationDelivery,
# else Do we need to create a simulation movement ? XXX probably not
return 1
security.declareProtected(Permissions.View, 'isDivergent')
security.declareProtected(Permissions.AccessContentsInformation, 'isDivergent')
def isDivergent(self, fast=0, **kw):
"""
Returns 1 if the target is not met according to the current information
......@@ -365,7 +365,7 @@ class Delivery(XMLObject, ImmobilisationDelivery,
return 1
return 0
security.declareProtected(Permissions.View, 'getDivergenceList')
security.declareProtected(Permissions.AccessContentsInformation, 'getDivergenceList')
def getDivergenceList(self, **kw):
"""
Return a list of messages that contains the divergences
......
......@@ -203,7 +203,7 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, ImmobilisationMovement):
"""
return XMLMatrix.getCellValueList(self, base_id=base_id)
security.declareProtected( Permissions.View, 'getCell' )
security.declareProtected( Permissions.AccessContentsInformation, 'getCell' )
def getCell(self, *kw , **kwd):
"""
This method can be overriden
......@@ -367,13 +367,13 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, ImmobilisationMovement):
# divergence support with solving
security.declareProtected(Permissions.View, 'isDivergent')
security.declareProtected(Permissions.AccessContentsInformation, 'isDivergent')
def isDivergent(self):
""" Returns true if the delivery line is divergent
"""
return bool(self.getDivergenceList())
security.declareProtected(Permissions.View, 'getDivergenceList')
security.declareProtected(Permissions.AccessContentsInformation, 'getDivergenceList')
def getDivergenceList(self):
"""
Return a list of messages that contains the divergences
......
......@@ -53,7 +53,7 @@ class DependentCapacity(Capacity):
, PropertySheet.Amount
)
security.declareProtected(Permissions.View, 'asCapacityItemList')
security.declareProtected(Permissions.AccessContentsInformation, 'asCapacityItemList')
def asCapacityItemList(self):
"""
Returns an association list of points and capacity values
......
......@@ -131,7 +131,7 @@ class ExternalSource(XMLObject, UrlMixin, CrawlableMixin):
"""
return None
security.declareProtected(Permissions.View, 'isIndexContent')
security.declareProtected(Permissions.AccessContentsInformation, 'isIndexContent')
def isIndexContent(self, content=None):
"""
This method is able to tell if content object is an index or
......
......@@ -392,7 +392,7 @@ class Image(TextConvertableMixin, File, OFSImage):
"""At least see if it *might* be valid."""
return self.getWidth() and self.getHeight() and self.getData() and self.getContentType()
security.declareProtected(Permissions.View, 'getSizeFromImageDisplay')
security.declareProtected(Permissions.AccessContentsInformation, 'getSizeFromImageDisplay')
def getSizeFromImageDisplay(self, image_display):
"""Return the size for this image display,
or dimension of this image.
......
......@@ -53,7 +53,7 @@ class IndependentCapacity(Capacity):
, PropertySheet.Amount
)
security.declareProtected(Permissions.View, 'asCapacityItemList')
security.declareProtected(Permissions.AccessContentsInformation, 'asCapacityItemList')
def asCapacityItemList(self):
"""
Returns an association list of points and capacity values
......
......@@ -157,7 +157,7 @@ class PDFDocument(Image):
text += result
return text
security.declareProtected(Permissions.View, 'getSizeFromImageDisplay')
security.declareProtected(Permissions.AccessContentsInformation, 'getSizeFromImageDisplay')
def getSizeFromImageDisplay(self, image_display):
"""
Return the size for this image display, or None if this image display name
......
......@@ -63,7 +63,7 @@ class SupplyChain(Path, XMLObject):
# Class variable
supply_link_portal_type="Supply Link"
security.declareProtected(Permissions.View, 'getLastLink')
security.declareProtected(Permissions.AccessContentsInformation, 'getLastLink')
def getLastLink(self):
"""
Return the SupplyLink representing the last ridge of the
......@@ -87,7 +87,7 @@ class SupplyChain(Path, XMLObject):
str(self.getRelativeUrl())
return result
security.declareProtected(Permissions.View,
security.declareProtected(Permissions.AccessContentsInformation,
'getNextSupplyLinkList')
def getNextSupplyLinkList(self, current_supply_link):
"""
......@@ -111,7 +111,7 @@ class SupplyChain(Path, XMLObject):
return next_production_list
return next_supply_link_list
security.declareProtected(Permissions.View,
security.declareProtected(Permissions.AccessContentsInformation,
'getNextProductionSupplyLinkList')
def getNextProductionSupplyLinkList(self, current_supply_link):
"""
......@@ -122,7 +122,7 @@ class SupplyChain(Path, XMLObject):
next_supply_link_list = self.getNextSupplyLinkList(current_supply_link)
return [x for x in next_supply_link_list if x.isProductionSupplyLink()]
security.declareProtected(Permissions.View,
security.declareProtected(Permissions.AccessContentsInformation,
'getNextProductionIndustrialPhaseList')
def getNextProductionIndustrialPhaseList(self, current_supply_link):
"""
......@@ -136,7 +136,7 @@ class SupplyChain(Path, XMLObject):
ind_phase_dict.pop(None, None)
return ind_phase_dict.keys()
security.declareProtected(Permissions.View,
security.declareProtected(Permissions.AccessContentsInformation,
'getPreviousSupplyLinkList')
def getPreviousSupplyLinkList(self, current_supply_link):
"""
......@@ -165,7 +165,7 @@ class SupplyChain(Path, XMLObject):
return previous_production_list
return previous_supply_link_list
security.declareProtected(Permissions.View,
security.declareProtected(Permissions.AccessContentsInformation,
'getPreviousProductionSupplyLinkList')
def getPreviousProductionSupplyLinkList(self, current_supply_link,
recursive=False, all=False,
......@@ -219,7 +219,7 @@ class SupplyChain(Path, XMLObject):
# Return result
return transformation_link_list
security.declareProtected(Permissions.View,
security.declareProtected(Permissions.AccessContentsInformation,
'getPreviousPackingListSupplyLinkList')
def getPreviousPackingListSupplyLinkList(self, current_supply_link,
recursive=False, all=False,
......@@ -286,7 +286,7 @@ class SupplyChain(Path, XMLObject):
ind_phase_list = ind_phase_dict.keys()
return ind_phase_list
security.declareProtected(Permissions.View,
security.declareProtected(Permissions.AccessContentsInformation,
'getPreviousProductionIndustrialPhaseList')
def getPreviousProductionIndustrialPhaseList(self, current_supply_link,
all=False):
......@@ -299,7 +299,7 @@ class SupplyChain(Path, XMLObject):
"getPreviousProductionSupplyLinkList",
all=all)
security.declareProtected(Permissions.View,
security.declareProtected(Permissions.AccessContentsInformation,
'getPreviousPackingListIndustrialPhaseList')
def getPreviousPackingListIndustrialPhaseList(self, current_supply_link):
"""
......@@ -311,7 +311,7 @@ class SupplyChain(Path, XMLObject):
"getPreviousPackingListSupplyLinkList",
include_current=True)
security.declareProtected(Permissions.View,
security.declareProtected(Permissions.AccessContentsInformation,
'test')
def test(self, current_supply_link, movement):
"""
......
......@@ -310,7 +310,7 @@ class Telephone(Coordinate, Base):
security.declareProtected(Permissions.ModifyPortalContent, '_setText')
_setText = fromText
security.declareProtected(Permissions.View, 'asText')
security.declareProtected(Permissions.AccessContentsInformation, 'asText')
def asText(self):
"""
Returns the telephone number in standard format
......@@ -379,10 +379,10 @@ class Telephone(Coordinate, Base):
return None
return 'tel:%s' % (url_string.replace(' ',''))
security.declareProtected(Permissions.View, 'getText')
security.declareProtected(Permissions.AccessContentsInformation, 'getText')
getText = asText
security.declareProtected(Permissions.View, 'standardTextFormat')
security.declareProtected(Permissions.AccessContentsInformation, 'standardTextFormat')
def standardTextFormat(self):
"""
Returns the standard text formats for telephone numbers
......
......@@ -116,7 +116,7 @@ class TextDocument(CachedConvertableMixin, BaseConvertableFileMixin,
return text
security.declareProtected(Permissions.View, 'asSubjectText')
security.declareProtected(Permissions.AccessContentsInformation, 'asSubjectText')
def asSubjectText(self, substitution_method_parameter_dict=None, safe_substitute=True, **kw):
"""
Converts the subject of the document to a textual representation.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment