1.1 --- a/pages/HelpOnMoinForms Sat Jan 19 22:50:29 2013 +0100
1.2 +++ b/pages/HelpOnMoinForms Sun Jan 20 18:24:06 2013 +0100
1.3 @@ -241,6 +241,38 @@
1.4
1.5 The `FormMessage` macro causes a message associated with a field to appear in the page. Although the macro is most likely to be used with error fields, it can insert the value of any field into the page.
1.6
1.7 +=== Storing Submitted Form Data ===
1.8 +
1.9 +The default form handler will store submitted form data in a `forms` subdirectory of the page on which a particular form appears, with each submitted form being encoded as a dictionary represented as a value encoded using Python syntax.
1.10 +
1.11 +=== Restricting Access to Forms ===
1.12 +
1.13 +By default, the usage of forms and the storage of form data is restricted according to the permissions granted for a given user for the page on which each form appears. This is summarised in the following table:
1.14 +
1.15 +|| '''Page Permission''' || '''Access to Form and Form Data''' ||
1.16 +|| `delete` || May delete form data (since the entire page may also be deleted) ||
1.17 +|| `read` || ''Permission grants no additional access'' ||
1.18 +|| `write` || May submit forms and store form data ||
1.19 +
1.20 +Thus, on any page for which a user only has read access, any form will by default be visible but not usable for submitting data.
1.21 +
1.22 +However, it is possible to change these restrictions by specifying an `access` keyword which defines the permissions that an unprivileged user has when using the form. For example:
1.23 +
1.24 +{{{{
1.25 +{{{#!form fragment=exampleform5 access=All:write
1.26 +...
1.27 +}}}
1.28 +}}}}
1.29 +
1.30 +Here, unprivileged users - those who may not change the page and thus change the form definition - may submit the form and store their submissions. The following table summarises the different `access` options:
1.31 +
1.32 +|| '''Access Option''' || '''Access to Form and Form Data''' ||
1.33 +|| `delete` || May delete form data ||
1.34 +|| `read` || May read form data ||
1.35 +|| `write` || May submit forms and store form data ||
1.36 +
1.37 +The `access` keyword supports conventional [[HelpOnAccessControlLists|ACL]] syntax.
1.38 +
1.39 === Extending the Default Form Handler ===
1.40
1.41 Specific applications will probably need to provide more sophisticated validation and handling of forms than the default action. This is most easily done by writing an action with the following general form: