Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
Add explicit security declaration on webdav.Collection class.
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Aug 7, 2016
1 parent 17b7906 commit 61a75f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/webdav/Collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from urllib import unquote

from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import delete_objects
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
from App.Common import rfc1123_date
from OFS.Lockable import wl_isLocked
Expand All @@ -39,6 +41,7 @@ class Collection(Resource):
than those for non-collection resources."""

implements(IDAVCollection)
security = ClassSecurityInfo()

__dav_collection__=1

Expand Down Expand Up @@ -76,6 +79,7 @@ def PUT(self, REQUEST, RESPONSE):
self.dav__init(REQUEST, RESPONSE)
raise MethodNotAllowed, 'Method not supported for collections.'

security.declareProtected(delete_objects, 'DELETE')
def DELETE(self, REQUEST, RESPONSE):
"""Delete a collection resource. For collection resources, DELETE
may return either 200 (OK) or 204 (No Content) to indicate total
Expand Down

0 comments on commit 61a75f6

Please sign in to comment.