Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Setup

.. warning::

This plugin requires Radicale 2.0 or higher.
This plugin requires Radicale 3.0 or higher.

Once `Radicale is installed
<http://radicale.org/documentation/>`_ on your server, you must
Expand Down
14 changes: 7 additions & 7 deletions modoboa_radicale/management/commands/generate_rights.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ def add_arguments(self, parser):
"--force", action="store_true", default=False,
help="Force generation of rights file")

def _generate_acr(self, name, user, collection, perm="rw", comment=None):
def _generate_acr(self, name, user, collection, perm="RrWw", comment=None):
"""Write a new access control rule to the config file."""
if comment is not None:
self._cfgfile.write("\n# %s" % comment)
self._cfgfile.write("""
[%s]
user = %s
collection = %s
permissions = %s
user: %s
collection: %s
permissions: %s
""" % (name, user, collection, perm)
)

Expand All @@ -45,9 +45,9 @@ def _user_access_rules(self):
)
permission = ""
if acr.read:
permission += "r"
permission += "Rr"
if acr.write:
permission += "w"
permission += "Ww"
self._generate_acr(
section, acr.mailbox.full_address, acr.calendar.path,
permission,
Expand All @@ -59,7 +59,7 @@ def _token_access_rules(self):
for calendar in model.objects.all():
section = "token-{}-access".format(calendar._path)
self._generate_acr(
section, calendar.access_token, calendar._path, perm="r",
section, calendar.access_token, calendar._path, perm="Rr",
comment="Read-only access using a token"
)

Expand Down