is_authorized returns True when no auth method is set
This commit is contained in:
parent
45afac5353
commit
b4a7ada5f2
@ -46,7 +46,7 @@ except ImportError:
|
|||||||
from urlparse import urlparse
|
from urlparse import urlparse
|
||||||
# pylint: enable=F0401,E0611
|
# pylint: enable=F0401,E0611
|
||||||
|
|
||||||
from radicale import config, ical, log, storage, xmlutils, access
|
from radicale import access, config, ical, log, storage, xmlutils
|
||||||
|
|
||||||
|
|
||||||
VERSION = "git"
|
VERSION = "git"
|
||||||
@ -199,10 +199,7 @@ class Application(object):
|
|||||||
function = getattr(self, environ["REQUEST_METHOD"].lower())
|
function = getattr(self, environ["REQUEST_METHOD"].lower())
|
||||||
|
|
||||||
# Check rights
|
# Check rights
|
||||||
if not items or not access or function == self.options:
|
if items and function != self.options:
|
||||||
# No collection, or no auth, or OPTIONS request: don't check rights
|
|
||||||
status, headers, answer = function(environ, items, content, None)
|
|
||||||
else:
|
|
||||||
# Ask authentication backend to check rights
|
# Ask authentication backend to check rights
|
||||||
authorization = environ.get("HTTP_AUTHORIZATION", None)
|
authorization = environ.get("HTTP_AUTHORIZATION", None)
|
||||||
|
|
||||||
|
@ -38,6 +38,8 @@ def load():
|
|||||||
|
|
||||||
def is_authenticated(user, password):
|
def is_authenticated(user, password):
|
||||||
"""Check if the user is authenticated."""
|
"""Check if the user is authenticated."""
|
||||||
|
if AUTH is None:
|
||||||
|
return True
|
||||||
return AUTH.is_authenticated(user, password) if user else False
|
return AUTH.is_authenticated(user, password) if user else False
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user