none
[openafs-wiki.git] / TWiki / TWikiAccessControl.mdwn
1 ## <a name="TWiki Access Control"></a> TWiki Access Control
2
3 %WIKITOOLNAME% allows you to define restrictions of who is allowed to view a %WIKITOOLNAME% web, make changes to topics or attach files.
4
5 **IMPORTANT NOTE:** Think twice before restricting read or write access to a web or a topic, because an open system where everybody can contribute is the essence of the [[WikiCulture]]. Experience shows that unrestricted write access works very well because:
6
7 - There is enough peer pressure to post only conform content.
8 - Content does not get lost because topics are under revision control.
9 - A topic revision can be undone by a member of the [[TWikiAdminGroup]] in case needed.
10
11 ### <a name="Users and Groups"></a> Users and Groups
12
13 Access control is based on users and groups.
14
15 **_Users_** are defined by the user topics in the Main web, i.e. [[TWikiGuest]]
16
17 - Users can be authenticated using basic authentication or SSL. [Installation Notes](TWikiDocumentation#installation) has more.
18
19 **_Groups_** are defined by group topics in the Main web, i.e. [[TWikiAdminGroup]]
20
21 - A group topic name must end in **...Group**
22 - The group topic should define these two variables:
23   - Set GROUP = &lt; list of users and groups &gt;
24   - Set ALLOWTOPICCHANGE = &lt; list of users and groups &gt;
25 - GROUP defines the members of the group; it is a comma delimited list of users and other groups. Example: <br />`    * Set GROUP = Main.SomeUser, Main.OtherUser, Main.SomeOtherGroup`
26 - ALLOWTOPICCHANGE defines who is allowed to change the group topic; it is a comma delimited list of users and groups. You typically want to restrict that to the members of the group itself, so it should contain the name of the topic, i.e. <br />`    * Set ALLOWTOPICCHANGE = Main.TWikiAdminGroup`<br /> for the TWikiAdminGroup topic. (This is to prevent users not in the group from editing the topic and gaining unauthorized membership to the group.)
27
28 ### <a name="Write Access Restriction for Ind"></a> Write Access Restriction for Individual Topics
29
30 You can define restrictions of who is allowed to make changes to a topic or attach files to it.
31
32 Define one or both of these variables in a topic, preferably at the end of the topic:
33
34 - Set DENYTOPICCHANGE = &lt; list of users and groups &gt;
35 - Set ALLOWTOPICCHANGE = &lt; list of users and groups &gt;
36
37 DENYTOPICCHANGE defines users or groups that **are not** allowed to make changes to the topic. It is a comma delimited list of users and groups. Example: <br />`    * Set DENYTOPICCHANGE = Main.SomeBadBoy, Main.SomeBadGirl, Main.SomeHackerGroup`
38
39 ALLOWTOPICCHANGE defines users or groups that **are** allowed to make changes to the topic. It is a comma delimited list of users and groups. Example: <br />`    * Set ALLOWTOPICCHANGE = Main.SomeGoodGuy, Main.SomeGoodGirl, Main.TWikiAdminGroup`
40
41 DENYTOPICCHANGE is evaluated before ALLOWTOPICCHANGE. Access is denied if the authenticated person is in the DENYTOPICCHANGE list, or not in the ALLOWTOPICCHANGE list. Access is granted in case DENYTOPICCHANGE and ALLOWTOPICCHANGE is not defined.
42
43 ### <a name="Write Access Restriction for a W"></a> Write Access Restriction for a Whole %WIKITOOLNAME% Web
44
45 You can define restrictions of who is allowed to make changes to a %WIKITOOLNAME% web. This includes creating new topics, changing topics or attaching files.
46
47 Define one or both of these variable in the [[WebPreferences]] topic:
48
49 - Set DENYWEBCHANGE = &lt; list of users and groups &gt;
50 - Set ALLOWWEBCHANGE = &lt; list of users and groups &gt;
51
52 The same rules apply like the one for Access Control for Individual Topics; with these additions:
53
54 - DENYTOPICCHANGE (in topic) overrides DENYWEBCHANGE (in WebPreferences)
55 - ALLOWTOPICCHANGE (in topic) overrides ALLOWWEBCHANGE (in WebPreferences)
56
57 ### <a name="Read Access Restriction for a Wh"></a> Read Access Restriction for a Whole %WIKITOOLNAME% Web
58
59 You can define restrictions of who is allowed to view a %WIKITOOLNAME% web.
60
61 Define one or both of these variable in the [[WebPreferences]] topic:
62
63 - Set DENYWEBVIEW = &lt; list of users and groups &gt;
64 - Set ALLOWWEBVIEW = &lt; list of users and groups &gt;
65
66 _Notes for read access restriction:_
67
68 - The view restriction is not suitable for very sensitive content since there is a way to circumvent the read access restriction.
69 - Read access restriction only works if the view script is authenticated, that means that users need to log on also just to read topics. [TWiki Installation](TWikiDocumentation#installation) has more on basic authentication based on the `.htaccess` file.
70 - There is a workaround if you prefer to to have unrestricted access to view topics located in normal webs, and to authenticate users only for webs where view restriction is enabled:
71   - Leave the `view` script non authenticated in the `.htaccess` file.
72   - Enable the `$doRememberRemoteUser` flag in `wikicfg.pm` as described in [TWiki Authentication](TWikiDocumentation#authentication). %WIKITOOLNAME% will now remember the IP address of an authenticated user.
73   - Copy the `view` script to `viewauth` (or better, create a symbolic link)
74   - Add `viewauth` to the list of authenticated scripts in the .htaccess file.
75   - When a user accesses a web where you enabled view restriction, %WIKITOOLNAME% will redirect from the `view` script to the `viewauth` script once (this hapens only if the user has never edited a topic). Doing so will ask for authentication. The `viewauth` script shows the requested topic if the user could log on and if the user is authorized to see that web.
76 - If you enable view restriction for a web, it is recommended to restrict search "all webs" from searching this web. Enable this restriction with the `NOSEARCHALL` variable in its [[WebPreferences]], like:
77   - Set NOSEARCHALL = on
78 - It is not recommended to restrict view access to individual topics since all content is searchable **_within_** a web.
79 - The view restriction is not suitable for very sensitive content since there is a way to circumvent the read access restriction.
80
81 **_Related topics:_** [[TWikiPreferences]], [[WebPreferences]] (in every web), [[TWikiAdminGroup]], [[TWikiGroups]]
82
83 -- [[PeterThoeny]] - 16 Mar 2001 <br />