2016-08-11 19:03:50 +02:00
|
|
|
---
|
|
|
|
layout: page
|
|
|
|
title: Authentication and Rights
|
|
|
|
permalink: /rights/
|
|
|
|
---
|
2017-05-24 19:13:47 +02:00
|
|
|
|
2017-05-27 12:06:41 +02:00
|
|
|
This page describes the format of the rights file for the `from_file`
|
|
|
|
authentication backend. The configuration option `file` in the `rights`
|
2017-05-24 19:13:47 +02:00
|
|
|
section must point to the rights file.
|
|
|
|
|
2017-09-10 21:39:01 +02:00
|
|
|
The recommended rights method is `owner_only`. If access to calendars
|
2017-05-27 12:06:41 +02:00
|
|
|
and address books outside of the home directory of users (that's `/USERNAME/`)
|
2017-05-24 19:13:47 +02:00
|
|
|
is granted, clients won't detect these collections and will not show them to
|
|
|
|
the user.
|
|
|
|
This is only useful if you access calendars and address books directly via URL.
|
|
|
|
|
|
|
|
An example rights file:
|
2017-05-27 12:45:56 +02:00
|
|
|
```ini
|
2017-05-24 19:13:47 +02:00
|
|
|
# The user "admin" can read and write any collection.
|
|
|
|
[admin]
|
2017-05-27 12:06:41 +02:00
|
|
|
user = admin
|
|
|
|
collection = .*
|
|
|
|
permission = rw
|
2017-05-24 19:13:47 +02:00
|
|
|
|
|
|
|
# Block access for the user "user" to everything.
|
|
|
|
[block]
|
2017-05-27 12:06:41 +02:00
|
|
|
user = user
|
|
|
|
collection = .*
|
|
|
|
permission =
|
2017-05-24 19:13:47 +02:00
|
|
|
|
|
|
|
# Authenticated users can read and write their own collections.
|
|
|
|
[owner-write]
|
2017-05-27 12:06:41 +02:00
|
|
|
user = .+
|
2017-08-17 06:45:40 +02:00
|
|
|
collection = %(login)s(/.*)?
|
2017-05-27 12:06:41 +02:00
|
|
|
permission = rw
|
2017-05-24 19:13:47 +02:00
|
|
|
|
|
|
|
# Everyone can read the root collection
|
|
|
|
[read]
|
2017-05-27 12:06:41 +02:00
|
|
|
user = .*
|
|
|
|
collection =
|
|
|
|
permission = r
|
2017-05-24 19:13:47 +02:00
|
|
|
```
|
|
|
|
|
2017-05-27 12:06:41 +02:00
|
|
|
The titles of the sections are ignored (but must be unique). The keys `user`
|
|
|
|
and `collection` contain regular expressions, that are matched against the
|
2017-05-24 19:13:47 +02:00
|
|
|
user name and the path of the collection. Permissions from the first
|
|
|
|
matching section are used. If no section matches, access gets denied.
|
|
|
|
|
2017-05-27 12:06:41 +02:00
|
|
|
The user name is empty for anonymous users. Therefore, the regex `.+` only
|
|
|
|
matches authenticated users and `.*` matches everyone (including anonymous
|
2017-05-24 19:13:47 +02:00
|
|
|
users).
|
|
|
|
|
2017-05-27 12:06:41 +02:00
|
|
|
The path of the collection is separated by `/` and has no leading or trailing
|
|
|
|
`/`. Therefore, the path of the root collection is empty.
|
2017-05-24 19:13:47 +02:00
|
|
|
|
2017-05-27 12:06:41 +02:00
|
|
|
`%(login)s` gets replaced by the user name and `%(path)s` by the path of
|
|
|
|
the collection. You can also get groups from the `user` regex in the
|
|
|
|
`collection` regex with `{0}`, `{1}`, etc.
|