1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-01 18:18:31 +00:00

Clean support of public calendars, add support of private calendars

This commit is contained in:
Guillaume Ayoub 2011-06-13 22:15:52 +02:00
parent a28bd4a5fa
commit f9836ab093
7 changed files with 42 additions and 13 deletions

View file

@ -26,7 +26,7 @@ Authentication based on the ``python-ldap`` module
"""
import ldap
from radicale import config, log
from radicale import acl, config, log
BASE = config.get("acl", "ldap_base")
@ -38,8 +38,8 @@ PASSWORD = config.get("acl", "ldap_password")
def has_right(owner, user, password):
"""Check if ``user``/``password`` couple is valid."""
if not user or (owner and user != owner):
# No user given, or owner is set and is not user, forbidden
if not user or (owner not in acl.PRIVATE_USERS and user != owner):
# No user given, or owner is not private and is not user, forbidden
return False
if BINDDN and PASSWORD: