Fix wrong syntax in config file and fix #58
This commit is contained in:
parent
56581a998a
commit
7ac971e022
@ -283,7 +283,7 @@ class Application(object):
|
|||||||
self.collect_allowed_items(items, user)
|
self.collect_allowed_items(items, user)
|
||||||
|
|
||||||
if ((read_allowed_items or write_allowed_items)
|
if ((read_allowed_items or write_allowed_items)
|
||||||
and auth.is_authenticated(user, password)) or \
|
and (not user or auth.is_authenticated(user, password))) or \
|
||||||
function == self.options or not items:
|
function == self.options or not items:
|
||||||
# Collections found, or OPTIONS request, or no items at all
|
# Collections found, or OPTIONS request, or no items at all
|
||||||
status, headers, answer = function(
|
status, headers, answer = function(
|
||||||
@ -292,8 +292,9 @@ class Application(object):
|
|||||||
else:
|
else:
|
||||||
status, headers, answer = NOT_ALLOWED
|
status, headers, answer = NOT_ALLOWED
|
||||||
|
|
||||||
if (status, headers, answer) == NOT_ALLOWED and \
|
if ((status, headers, answer) == NOT_ALLOWED and
|
||||||
not auth.is_authenticated(user, password):
|
not auth.is_authenticated(user, password) and
|
||||||
|
config.get("auth", "type") != "None"):
|
||||||
# Unknown or unauthorized user
|
# Unknown or unauthorized user
|
||||||
log.LOGGER.info("%s refused" % (user or "Anonymous user"))
|
log.LOGGER.info("%s refused" % (user or "Anonymous user"))
|
||||||
status = client.UNAUTHORIZED
|
status = client.UNAUTHORIZED
|
||||||
|
Loading…
Reference in New Issue
Block a user