none
[openafs-wiki.git] / TWiki / TWikiAccessControl.mdwn
1 <div>
2   <ul>
3     <li><a href="#TWiki Access Control"> TWiki Access Control</a><ul>
4         <li><a href="#Overview"> Overview</a></li>
5         <li><a href="#Users and Groups"> Users and Groups</a><ul>
6             <li><a href="#Managing Users"> Managing Users</a></li>
7             <li><a href="#Managing Groups"> Managing Groups</a></li>
8           </ul>
9         </li>
10         <li><a href="#Restricting Write Access"> Restricting Write Access</a><ul>
11             <li><a href="#Deny Editing by Topic"> Deny Editing by Topic</a></li>
12             <li><a href="#Deny Editing by Web"> Deny Editing by Web</a></li>
13           </ul>
14         </li>
15         <li><a href="#Restricting Rename Access"> Restricting Rename Access</a><ul>
16             <li><a href="#Deny Renaming by Topic"> Deny Renaming by Topic</a></li>
17             <li><a href="#Deny Renaming by Web"> Deny Renaming by Web</a></li>
18           </ul>
19         </li>
20         <li><a href="#Restricting Read Access"> Restricting Read Access</a><ul>
21             <li><a href="#Known Issues"> Known Issues</a><ul>
22                 <li><a href="#Selective Unrestricted Web Acces"> Selective Unrestricted Web Access</a></li>
23               </ul>
24             </li>
25           </ul>
26         </li>
27         <li><a href="#The _SuperAdminGroup"> The SuperAdminGroup</a></li>
28       </ul>
29     </li>
30   </ul>
31 </div>
32
33 ## <a name="TWiki Access Control"></a> TWiki Access Control
34
35 _Restricting read and write access to topics and webs, by users and groups_
36
37 ### <a name="Overview"></a> Overview
38
39 %WIKITOOLNAME% allows you to define restrictions of who is allowed to view a %WIKITOOLNAME% web, make changes to topics or attach files.
40
41 **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:
42
43 - Peer influence is enough to ensure that only relevant content is posted.
44 - Peer editing - edit anything on a page - keeps topics focussed.
45 - All content is preserved under revision control.
46   - Edits can be undone by the [[TWikiAdminGroup]] (the default administrators group; see [[Managing Groups|Main/WebHome#ManagingGroups]]).
47   - Editing and refactoring (condensing a long topic) is encouraged (there's a safety net).
48
49 ### <a name="Users and Groups"></a> Users and Groups
50
51 Access control is based on users and groups.
52
53 #### <a name="Managing Users"></a> Managing Users
54
55 A user is created by with the TWikiRegistration form. The process generates a topic in the Main web in the new user's [[WikiName]]. The default visitor name is [[TWikiGuest]].
56
57 - Users can be authenticated using Basic Authentication or SSL. [[TWiki Authentication|Main/TWikiDocumentation#TWikiAuthentication]] has more.
58
59 <a name="ManagingGroups"></a>
60
61 #### <a name="Managing Groups"></a> Managing Groups
62
63 Groups are defined by group topics in the Main web, like the [[TWikiAdminGroup]].
64
65 - A group topic name must end in **\_Group**
66 - The group topic should define these two variables:
67
68 > - - Set GROUP = &lt; list of users and groups &gt;
69 >   - Set ALLOWTOPICCHANGE = &lt; list of users and groups &gt;
70
71 - GROUP defines the members of the group; it is a comma delimited list of users and other groups. Example: <br /><code>**    \* Set GROUP = Main.SomeUser, Main.OtherUser, Main.SomeOtherGroup**</code>
72 - 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.)
73
74 ### <a name="Restricting Write Access"></a> Restricting Write Access
75
76 #### <a name="Deny Editing by Topic"></a> Deny Editing by Topic
77
78 You can define restrictions of who is allowed to make changes to a topic or attach files to it.
79
80 Define one or both of these variables in a topic, preferably at the end of the topic:
81
82 - Set DENYTOPICCHANGE = &lt; list of users and groups &gt;
83 - Set ALLOWTOPICCHANGE = &lt; list of users and groups &gt;
84
85 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`
86
87 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`
88
89 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.
90
91 #### <a name="Deny Editing by Web"></a> Deny Editing by Web
92
93 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.
94
95 Define one or both of these variable in the [[WebPreferences]] topic:
96
97 - Set DENYWEBCHANGE = &lt; list of users and groups &gt;
98 - Set ALLOWWEBCHANGE = &lt; list of users and groups &gt;
99
100 The same rules apply like the one for Access Control for Individual Topics; with these additions:
101
102 - DENYTOPICCHANGE (in topic) overrides DENYWEBCHANGE (in WebPreferences)
103 - ALLOWTOPICCHANGE (in topic) overrides ALLOWWEBCHANGE (in WebPreferences)
104
105 ### <a name="Restricting Rename Access"></a> Restricting Rename Access
106
107 #### <a name="Deny Renaming by Topic"></a> Deny Renaming by Topic
108
109 You can define restrictions of who is allowed to rename a topic. Note that users need this permission in addition to the CHANGE permission in order to rename a topic. They also need CHANGE access to change references in referring topics.
110
111 Define one or both of these variables in a topic, preferably at the end of the topic:
112
113 - Set DENYTOPICRENAME = &lt; list of users and groups &gt;
114 - Set ALLOWTOPICRENAME = &lt; list of users and groups &gt;
115
116 DENYTOPICCRENAME defines users or groups that **are not** allowed to rename the topic. It is a comma delimited list of users and groups. Example: <br />`    * Set DENYTOPICRENAME = Main.SomeBadBoy, Main.SomeBadGirl, Main.SomeHackerGroup`
117
118 ALLOWTOPICRENAME defines users or groups that **are** allowed to rename the topic. It is a comma delimited list of users and groups. Example: <br />`    * Set ALLOWTOPICRENAME = Main.SomeGoodGuy, Main.SomeGoodGirl, Main.TWikiAdminGroup`
119
120 DENYTOPICRENAME is evaluated before ALLOWTOPICRENAME. Access is denied if the authenticated person is in the DENYTOPICRENAME list, or not in the ALLOWTOPICRENAME list. Access is granted in case DENYTOPICRENAME and ALLOWTOPICRENAME is not defined.
121
122 #### <a name="Deny Renaming by Web"></a> Deny Renaming by Web
123
124 You can define restrictions of who is allowed to do renames for a %WIKITOOLNAME% web.
125
126 Define one or both of these variable in the [[WebPreferences]] topic:
127
128 - Set DENYWEBRENAME = &lt; list of users and groups &gt;
129 - Set ALLOWWEBRENAME = &lt; list of users and groups &gt;
130
131 The same rules apply like the one for Access Control for Individual Topics; with these additions:
132
133 - DENYTOPICRENAME (in topic) overrides DENYWEBRENAME (in WebPreferences)
134 - ALLOWTOPICRENAME (in topic) overrides ALLOWWEBRENAME (in WebPreferences)
135
136 ### <a name="Restricting Read Access"></a> Restricting Read Access
137
138 You can define restrictions of who is allowed to view a %WIKITOOLNAME% web.
139
140 Define one or both of these variable in the [[WebPreferences]] topic:
141
142 - Set DENYWEBVIEW = &lt; list of users and groups &gt;
143 - Set ALLOWWEBVIEW = &lt; list of users and groups &gt;
144
145 #### <a name="Known Issues"></a> Known Issues
146
147 - The view restriction is not suitable for very sensitive content since there is a way to circumvent the read access restriction.
148 - 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 Guide|Main/TWikiDocumentation#TWikiInstallationGuide]] has more on Basic Authentication based on the <code>**.htaccess**</code> file.
149
150 ##### <a name="Selective Unrestricted Web Acces"></a> Selective Unrestricted Web Access
151
152 - There is a workaround if you prefer to have unrestricted access to view topics located in normal webs, and to authenticate users only for webs where view restriction is enabled:
153   - Leave the <code>**view**</code> script non-authenticated in the `.htaccess` file.
154   - Enable the <code>**$doRememberRemoteUser**</code> flag in <code>**lib/wikicfg.pm**</code> as described in [[User Authentication|Main/TWikiDocumentation#TWikiUserAuthentication]]. %WIKITOOLNAME% will now remember the IP address of an authenticated user.
155   - Copy the <code>**view**</code> script to <code>**viewauth**</code> (or better, create a symbolic link)
156   - Add <code>**viewauth**</code> to the list of authenticated scripts in the .htaccess file.
157   - When a user accesses a web where you enabled view restriction, %WIKITOOLNAME% will redirect from the `view` script to the `viewauth` script once (this happens 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.
158 - 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 <code>**NOSEARCHALL**</code> variable in its [[WebPreferences]], like:
159   - Set NOSEARCHALL = on
160 - It is not recommended to restrict view access to individual topics since all content is searchable _within_ a web.
161
162 <a name="SuperAdminGroup"></a>
163
164 ### <a name="The _SuperAdminGroup"></a> The SuperAdminGroup
165
166 The above schema can lock completely a topic in case of a typing error of the ALLOWTOPICCHANGE setting (see [[UnchangeableTopicBug]] for more detail). To avoid this:
167
168 - Set the <code>**$superAdminGroup**</code> variable in <code>**lib/TWiki.cfg**</code> to the name of a group of users that are always allowed to edit/view topics.
169
170     $superAdminGroup = "TWikiAdminGroup";
171
172 - The default setting is not to have superusers.
173
174 -- [[PeterThoeny]] - 16 Mar 2001 <br /> -- [[AndreaSterbini]] - 11 Apr 2001 <br />
175
176 **_Related topics:_** [[TWikiPreferences]], [[WebPreferences]] (in every web), [[TWikiAdminGroup]], [[TWikiGroups]]