Accesscontrol

The accesscontrol extension

If you want to restrict access for some sites, this extension is for you.

Loading the extension

To use that extension, load OCamlfind package ocsigenserver.ext.accesscontrol, either from your Dune file (if you are using static linking), or from the configuration file:

<extension findlib-package="ocsigenserver.ext.accesscontrol"/>

Here, we call actions elements that can be put in a site configuration. Actions include <eliom>, <static>, etc. This extension defines several actions.

This page describes the configuration file options. If you are building a statically linked executable without configuration file, use the corresponding functions from module Accesscontrol.

The <if> action

It takes as children a condition followed by a <then> element and possibly an <else> element. When a request reaches an <if>, if the condition evaluates to true, then the whole <if> behaves as if it had been replaced by the contents of the <then> element, otherwise it behaves as if it had been replaced by the contents of the <else> element. A missing <else> is considered as an <else> with no children.

Conditions

Atomic conditions:

Combining conditions (all their children must be conditions):

Other actions

Examples