Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
erp5
Commits
5fd0ed6d
Commit
5fd0ed6d
authored
Feb 05, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CachedConvertableMixin: fix security definitions
parent
f1050443
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
product/ERP5/mixin/cached_convertable.py
product/ERP5/mixin/cached_convertable.py
+5
-6
No files found.
product/ERP5/mixin/cached_convertable.py
View file @
5fd0ed6d
...
@@ -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
):
"""
"""
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment