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