1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-09-15 20:36:55 +00:00

Improve documentation

This commit is contained in:
Unrud 2020-01-12 23:32:28 +01:00
parent 6202257fc2
commit 88a0af8ba1
25 changed files with 207 additions and 76 deletions

View file

@ -16,25 +16,17 @@
# along with Radicale. If not, see <http://www.gnu.org/licenses/>.
"""
Rights backends.
The rights module used to determine if a user can read and/or write
collections and entries.
This module loads the rights backend, according to the rights
configuration.
Permissions:
Default rights are based on a regex-based file whose name is specified in the
config (section "right", key "file").
- R: read a collection
- r: read an address book or calendar entry
- W: write a collection
- w: read an address book or calendar entry
Authentication login is matched against the "user" key, and collection's path
is matched against the "collection" key. You can use Python's ConfigParser
interpolation values %(login)s and %(path)s. You can also get groups from the
user regex in the collection with {0}, {1}, etc.
For example, for the "user" key, ".+" means "authenticated user" and ".*"
means "anybody" (including anonymous users).
Section names are only used for naming the rule.
Leading or ending slashes are trimmed from collection's path.
Take a look at the class ``BaseRights`` if you want to implement your own.
"""

View file

@ -15,6 +15,11 @@
# You should have received a copy of the GNU General Public License
# along with Radicale. If not, see <http://www.gnu.org/licenses/>.
"""
Rights backend that allows authenticated users to read and write all
calendars and address books.
"""
from radicale import pathutils, rights

View file

@ -15,6 +15,24 @@
# You should have received a copy of the GNU General Public License
# along with Radicale. If not, see <http://www.gnu.org/licenses/>.
"""
Rights backend based on a regex-based file whose name is specified in the
config (section "right", key "file").
Authentication login is matched against the "user" key, and collection's path
is matched against the "collection" key. You can use Python's ConfigParser
interpolation values %(login)s and %(path)s. You can also get groups from the
user regex in the collection with {0}, {1}, etc.
For example, for the "user" key, ".+" means "authenticated user" and ".*"
means "anybody" (including anonymous users).
Section names are only used for naming the rule.
Leading or ending slashes are trimmed from collection's path.
"""
import configparser
import re

View file

@ -15,6 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with Radicale. If not, see <http://www.gnu.org/licenses/>.
"""
Rights backend that allows authenticated users to read and write their own
calendars and address books.
"""
import radicale.rights.authenticated as authenticated
from radicale import pathutils, rights

View file

@ -15,6 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with Radicale. If not, see <http://www.gnu.org/licenses/>.
"""
Rights backend that allows authenticated users to read all calendars and
address books but only grants write access to their own.
"""
import radicale.rights.authenticated as authenticated
from radicale import pathutils, rights