Commit 5fd0ed6d authored by Jérome Perrin's avatar Jérome Perrin

CachedConvertableMixin: fix security definitions

parent f1050443
...@@ -106,7 +106,7 @@ class CachedConvertableMixin: ...@@ -106,7 +106,7 @@ class CachedConvertableMixin:
return '%s:%s:%s' % (aq_base(self).getUid(), self.getRevision(), return '%s:%s:%s' % (aq_base(self).getUid(), self.getRevision(),
format_cache_id) format_cache_id)
security.declareProtected(Permissions.View, 'hasConversion') security.declareProtected(Permissions.AccessContentsInformation, 'hasConversion')
def hasConversion(self, **kw): def hasConversion(self, **kw):
""" """
""" """
...@@ -170,7 +170,6 @@ class CachedConvertableMixin: ...@@ -170,7 +170,6 @@ class CachedConvertableMixin:
tv[cache_id] = stored_data_dict tv[cache_id] = stored_data_dict
cache_factory.set(cache_id, stored_data_dict) cache_factory.set(cache_id, stored_data_dict)
security.declareProtected(Permissions.View, '_getConversionDataDict')
def _getConversionDataDict(self, **kw): def _getConversionDataDict(self, **kw):
""" """
""" """
...@@ -212,7 +211,7 @@ class CachedConvertableMixin: ...@@ -212,7 +211,7 @@ class CachedConvertableMixin:
raise KeyError, 'Conversion cache key does not exists for %r' % cache_id raise KeyError, 'Conversion cache key does not exists for %r' % cache_id
security.declareProtected(Permissions.View, 'getConversion') security.declareProtected(Permissions.AccessContentsInformation, 'getConversion')
def getConversion(self, **kw): def getConversion(self, **kw):
""" """
""" """
...@@ -225,19 +224,19 @@ class CachedConvertableMixin: ...@@ -225,19 +224,19 @@ class CachedConvertableMixin:
data = str(data) data = str(data)
return mime, data return mime, data
security.declareProtected(Permissions.View, 'getConversionSize') security.declareProtected(Permissions.AccessContentsInformation, 'getConversionSize')
def getConversionSize(self, **kw): def getConversionSize(self, **kw):
""" """
""" """
return self._getConversionDataDict(**kw)['size'] return self._getConversionDataDict(**kw)['size']
security.declareProtected(Permissions.View, 'getConversionDate') security.declareProtected(Permissions.AccessContentsInformation, 'getConversionDate')
def getConversionDate(self, **kw): def getConversionDate(self, **kw):
""" """
""" """
return self._getConversionDataDict(**kw)['date'] return self._getConversionDataDict(**kw)['date']
security.declareProtected(Permissions.View, 'getConversionMd5') security.declareProtected(Permissions.AccessContentsInformation, 'getConversionMd5')
def getConversionMd5(self, **kw): def getConversionMd5(self, **kw):
""" """
""" """
......
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