projects
/
Plinn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0f2a885
)
bugfix : checkIdAvailable était exécutée via l'acquisition…
author
Benoît Pin
<benoit.pin@gmail.com>
Wed, 9 Apr 2014 20:59:37 +0000
(22:59 +0200)
committer
Benoît Pin
<benoit.pin@gmail.com>
Wed, 9 Apr 2014 20:59:37 +0000
(22:59 +0200)
AttachmentTool.py
patch
|
blob
|
history
diff --git
a/AttachmentTool.py
b/AttachmentTool.py
index
4df5a3f
..
58c3e07
100644
(file)
--- a/
AttachmentTool.py
+++ b/
AttachmentTool.py
@@
-30,6
+30,7
@@
from OFS.SimpleItem import SimpleItem
from OFS.Folder import Folder
from OFS.Image import File, cookId
from zExceptions import Unauthorized
from OFS.Folder import Folder
from OFS.Image import File, cookId
from zExceptions import Unauthorized
+from zExceptions import BadRequest
from Products.Photo import Photo
from Products.CMFCore.utils import UniqueObject, getToolByName, getUtilityByInterfaceName
from Products.CMFCore.permissions import ModifyPortalContent
from Products.Photo import Photo
from Products.CMFCore.utils import UniqueObject, getToolByName, getUtilityByInterfaceName
from Products.CMFCore.permissions import ModifyPortalContent
@@
-114,6
+115,16
@@
class AttachmentContainer (Folder):
def __init__(self):
self.id = 'attachments'
def __init__(self):
self.id = 'attachments'
+ security.declarePrivate('checkIdAvailable')
+ def checkIdAvailable(self, id):
+ try:
+ self._checkId(id)
+ except BadRequest:
+ return False
+ else:
+ return True
+
+
security.declareProtected(ModifyPortalContent, 'put_upload')
def put_upload(self, REQUEST, RESPONSE):
""" Upload a content thru webdav put method.
security.declareProtected(ModifyPortalContent, 'put_upload')
def put_upload(self, REQUEST, RESPONSE):
""" Upload a content thru webdav put method.