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

@@ -183,17 +183,24 @@ class Application(object):
if last_allowed:
calendars.append(calendar)
continue
log.LOGGER.info(
"Checking rights for calendar owned by %s" % (
calendar.owner or "nobody"))
if self.acl.has_right(calendar.owner, user, password):
log.LOGGER.info("%s allowed" % (user or "anonymous user"))
if calendar.owner in acl.PUBLIC_USERS:
log.LOGGER.info("Public calendar")
calendars.append(calendar)
last_allowed = True
else:
log.LOGGER.info("%s refused" % (user or "anonymous user"))
last_allowed = False
log.LOGGER.info(
"Checking rights for calendar owned by %s" % (
calendar.owner or "nobody"))
if self.acl.has_right(calendar.owner, user, password):
log.LOGGER.info(
"%s allowed" % (user or "Anonymous user"))
calendars.append(calendar)
last_allowed = True
else:
log.LOGGER.info(
"%s refused" % (user or "Anonymous user"))
last_allowed = False
if calendars:
status, headers, answer = function(environ, calendars, content)