From 7ac971e022450bbb4d85d65257491e1fb39ed15f Mon Sep 17 00:00:00 2001 From: Jean-Marc Martins Date: Mon, 23 Dec 2013 16:45:15 +0100 Subject: [PATCH] Fix wrong syntax in config file and fix #58 --- radicale/__init__.py | 7 ++++--- rights | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index f14f4f3..b383638 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -283,7 +283,7 @@ class Application(object): self.collect_allowed_items(items, user) 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: # Collections found, or OPTIONS request, or no items at all status, headers, answer = function( @@ -292,8 +292,9 @@ class Application(object): else: status, headers, answer = NOT_ALLOWED - if (status, headers, answer) == NOT_ALLOWED and \ - not auth.is_authenticated(user, password): + if ((status, headers, answer) == NOT_ALLOWED and + not auth.is_authenticated(user, password) and + config.get("auth", "type") != "None"): # Unknown or unauthorized user log.LOGGER.info("%s refused" % (user or "Anonymous user")) status = client.UNAUTHORIZED diff --git a/rights b/rights index 0e25a52..d598e28 100644 --- a/rights +++ b/rights @@ -7,7 +7,7 @@ # This means all users starting with "admin" may read any collection [admin] -user: ^admin.*\|.+?$ +user: ^admin.*$ collection: .* permission: r