Merge pull request #570 from Unrud/patch-5

Fix permissions for REPORT request
This commit is contained in:
Guillaume Ayoub 2017-04-15 09:20:01 +02:00 committed by GitHub
commit b173307f55

View File

@ -677,12 +677,12 @@ class Application:
def do_REPORT(self, environ, base_prefix, path, user):
"""Manage REPORT request."""
if not self._access(user, path, "w"):
if not self._access(user, path, "r"):
return NOT_ALLOWED
content = self._read_content(environ)
with self.Collection.acquire_lock("r", user):
item = next(self.Collection.discover(path), None)
if not self._access(user, path, "w", item):
if not self._access(user, path, "r", item):
return NOT_ALLOWED
if not item:
return NOT_FOUND