(file) Return to TWikiAccessControl.txt CVS log (file) (dir) Up to [RizwankCVS] / geekymedia_web / twiki / data / TWiki

  1 rizwank 1.1 %META:TOPICINFO{author="PeterThoeny" date="1092559631" format="1.0" version="1.29"}%
  2             %TOC%
  3             %STARTINCLUDE%
  4             
  5             ---# TWiki Access Control
  6             
  7             _Restricting read and write access to topics and webs, by Users and groups_
  8             
  9             TWikiAccessControl allows you restrict access to single topics and entire webs, by individual user and by user Groups, in three areas: view; edit & attach; and rename/move/delete. Access control, combined with TWikiUserAuthentication, lets you easily create and manage an extremely flexible, fine-grained privilege system.
 10             
 11             ---++ An Important Control Consideration
 12             
 13             Open, freeform editing is the essence of WikiCulture - what makes TWiki different and often more effective than other collaboration tools. For that reason, it is strongly recommended that decisions to restrict read or write access to a web or a topic are made with care - the more restrictions, the less Wiki in the mix. Experience shows that _unrestricted write access_ works very well because:
 14             
 15             	* *Peer influence* is enough to ensure that only relevant content is posted.
 16             
 17             	* *Peer editing* - the ability for anyone to rearrange all content on a page - keeps topics focussed.
 18             
 19             	* In TWiki, content is transparently preserved under *revision control*:
 20             		* Edits can be undone by the %MAINWEB%.TWikiAdminGroup (the default administrators group; see [[#ManagingGroups]]).
 21             		* Users are encouraged to edit and refactor (condense a long topic), since there's a safety net.
 22 rizwank 1.1 
 23             As a *collaboration guideline*:
 24             
 25             	* Create broad-based Groups (for more and varied input), and...
 26             	* Avoid creating view-only Users (if you can read it, you should be able to contribute to it).
 27             
 28             ---++ Authentication vs. Access Control
 29             
 30             *Authentication:* Identifies who a user is based on a login procedure. See TWikiUserAuthentication.
 31             
 32             *Access control:* Restrict access to content based on users and groups once a user is identified.
 33             
 34             ---++ Users and Groups
 35             
 36             Access control is based on the familiar concept of Users and Groups. Users are defined by their WikiNames. They can then be organized in unlimited combinations by inclusion in one or more user Groups. For convenience, Groups can also be included in other Groups. 
 37             
 38             ---+++ Managing Users
 39             
 40             A user can create an account in TWikiRegistration. The following actions are performed:
 41             
 42             	* WikiName and encrypted password are recorded in =.htpasswd= if authentication is enabled.
 43 rizwank 1.1 	* A confirmation e-mail is sent to the user.
 44             	* A user home page with the WikiName of the user is created in the %MAINWEB% web.
 45             	* The user is added to the %MAINWEB%.%WIKIUSERSTOPIC% topic.
 46             
 47             Users can be authenticated using Basic Authentication (htaccess) or SSL (secure server). In either case, TWikiUserAuthentication is required in order to track user identities, and use User and Group access control.
 48             
 49             The default visitor name is %MAINWEB%.TWikiGuest. This is the non-authenticated user.
 50             
 51             #ManagingGroups
 52             ---+++ Managing Groups
 53             
 54             Groups are defined by group topics created in the ==%MAINWEB%== web, like the %MAINWEB%.TWikiAdminGroup. To create a new group:
 55             	1. ==Edit== %MAINWEB%.TWikiGroups by entering a new topic with a name that ends in ==Group==. Example:
 56             		* ==<nop>SomeGroup==
 57             	1. *Set Preferences* for two Variables in the new group topic:
 58             		* ==Set <nop>GROUP = &lt; list of Users and/or Groups &gt;==
 59             		* ==Set <nop>ALLOWTOPICCHANGE = &lt; list of Users and/or Groups &gt;==
 60             		* The GROUP variable is a comma-separated list of Users and/or other Groups. Example:
 61             			* ==Set GROUP = %MAINWEB%.<nop>SomeUser, %MAINWEB%.<nop>OtherUser, %MAINWEB%.<nop>SomeGroup==
 62             		* 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. (This prevents Users not in the Group from editing the topic to give themselves or others access. For example, for the <nop>TWikiAdminGroup topic write:
 63             		* ==Set ALLOWTOPICCHANGE = %MAINWEB%.<nop>TWikiAdminGroup==
 64 rizwank 1.1 
 65             ---++ Restricting Write Access
 66             
 67             You can define who is allowed to make changes to a web or a topic. 
 68             
 69             ---+++ Deny Editing by Topic
 70             
 71             Denying editing of a topic also restricts file attachment; both privileges are assigned together.
 72             	* Define one or both of these variables in a topic, preferably at the end of the page:
 73             		* ==Set <nop>DENYTOPICCHANGE = &lt; list of Users and Groups &gt;==
 74             		* ==Set <nop>ALLOWTOPICCHANGE = &lt; list of Users and Groups &gt;==
 75             
 76             	* DENYTOPICCHANGE defines Users or Groups that *are not* allowed to make changes to the topic, with a comma-delimited list. Example:
 77             		* ==Set <nop>DENYTOPICCHANGE = %MAINWEB%.<nop>SomeBadBoy, %MAINWEB%.<nop>SomeBadGirl, %MAINWEB%.<nop>SomeHackerGroup==
 78             
 79             	* 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:
 80             		* ==Set <nop>ALLOWTOPICCHANGE = %MAINWEB%.<nop>SomeGoodGuy, %MAINWEB%.<nop>SomeGoodGirl, %MAINWEB%.<nop>TWikiAdminGroup==
 81             
 82             	* 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.
 83             
 84             ---+++ Deny Editing by Web
 85 rizwank 1.1 
 86             Restricting web-level editing blocks creating new topics, changing topics or attaching files.
 87             
 88             	* Define one or both of these variable in the %WEBPREFSTOPIC% topic:
 89             		* ==Set <nop>DENYWEBCHANGE = &lt; list of Users and Groups &gt;==
 90             		* ==Set <nop>ALLOWWEBCHANGE = &lt; list of Users and Groups &gt;==
 91             
 92             The same rules apply as for restricting topics, with these additions:
 93             	* DENYTOPICCHANGE (in topic) overrides DENYWEBCHANGE (in <nop>%WEBPREFSTOPIC%)
 94             	* ALLOWTOPICCHANGE (in topic) overrides ALLOWWEBCHANGE (in <nop>%WEBPREFSTOPIC%)
 95             
 96             ---++ Restricting Rename Access
 97             
 98             You can define who is allowed to rename, move or delete a topic, or rename a web.
 99             
100             ---+++ Deny Renaming by Topic
101             
102             To allow a user to rename, move or delete a topic, they also need write (editing) permission.  They also need write access to change references in referring topics.
103             
104             	* Define one or both of these variables in a topic, preferably at the end of the topic:
105             		* ==Set <nop>DENYTOPICRENAME = &lt; list of Users and Groups &gt;==
106 rizwank 1.1 		* ==Set <nop>ALLOWTOPICRENAME = &lt; list of Users and Groups &gt;==
107             
108             	* DENYTOPICCRENAME defines Users or Groups that *are not* allowed to rename the topic. It is a comma delimited list of Users and Groups. Example:
109             		* ==Set <nop>DENYTOPICRENAME = %MAINWEB%.<nop>SomeBadBoy, %MAINWEB%.<nop>SomeBadGirl, %MAINWEB%.<nop>SomeHackerGroup==
110             
111             	* ALLOWTOPICRENAME defines Users or Groups that *are* allowed to rename the topic. It is a comma delimited list of Users and Groups. Example:
112             		* ==Set <nop>ALLOWTOPICRENAME = %MAINWEB%.<nop>SomeGoodGuy, %MAINWEB%.<nop>SomeGoodGirl, %MAINWEB%.<nop>TWikiAdminGroup==
113             
114             	* 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.
115             
116             ---+++ Deny Renaming by Web
117             
118             You can define restrictions of who is allowed to rename a %WIKITOOLNAME% web.
119             
120             	* Define one or both of these variable in the %WEBPREFSTOPIC% topic:
121             		* ==Set <nop>DENYWEBRENAME = &lt; list of Users and Groups &gt;==
122             		* ==Set <nop>ALLOWWEBRENAME = &lt; list of Users and Groups &gt;==
123             
124             The same rules apply as for topics, with these additions:
125             	* DENYTOPICRENAME (in topic) overrides DENYWEBRENAME (in <nop>%WEBPREFSTOPIC%)
126             	* ALLOWTOPICRENAME (in topic) overrides ALLOWWEBRENAME (in <nop>%WEBPREFSTOPIC%)
127 rizwank 1.1 
128             ---++ Restricting Read Access
129             
130             You can define who is allowed to see a web.
131             
132             ---+++ Deny Viewing by Topic
133             
134             %X% Technically it is possible to restrict read access to an individual topic based on ==DENYTOPICVIEW== / ==ALLOWTOPICVIEW== preferences variables, provided that the view script is authenticated. However this setup is not recommended since all content is searchable within a web - a search will turn up view restricted topics.
135             
136             ---+++ Deny Viewing by Web
137             
138             You can define restrictions of who is allowed to view a %WIKITOOLNAME% web. You can restrict access to certain webs to selected Users and Groups, by:
139             
140             	* *obfuscating webs:* Insecure but handy method to hide new webs until content is ready for deployment.
141             	* *authenticating all webs and restricting selected webs:* Topic access in all webs is authenticated, and selected webs have restricted access.
142             	* *authenticating and restricting selected webs only:* Provide unrestricted viewing access to open webs, with authentication and restriction only on selected webs.
143             
144             ---++++ Obfuscate Webs
145             
146             The idea is to keep a web hidden by not publishing its URL and by preventing the ==all webs== search option from accessing obfuscated webs. Do so by enabling the ==NOSEARCHALL== variable in %WEBPREFSTOPIC%:
147             	* ==Set <nop>NOSEARCHALL = on==
148 rizwank 1.1 
149             This setup can be useful to hide a new web until content its ready for deployment.
150             
151             %X% *Obfuscating webs is insecure*, as anyone who knows the URL can access the web.
152             
153             ---++++ Authenticate all Webs and Restrict Selected Webs
154             
155             Use the following setup to authenticate users for topic viewing in all webs and to restrict access to selected webs:
156             
157             	1. *Restrict* view access to selected Users and Groups. Set one or both of these variables in its %WEBPREFSTOPIC% topic:
158             		* ==Set <nop>DENYWEBVIEW = &lt; list of Users and Groups &gt;==
159             		* ==Set <nop>ALLOWWEBVIEW = &lt; list of Users and Groups &gt;==
160             		* __Note:__ =DENYWEBVIEW= is evaluated before =ALLOWWEBVIEW=. Access is denied if the authenticated person is in the =DENYWEBVIEW= list, or not in the =ALLOWWEBVIEW= list. Access is granted in case =DENYWEBVIEW= and =ALLOWWEBVIEW= is not defined.
161             	1. *Hide* the web from an "all webs" search. Enable this restriction with the ==NOSEARCHALL== variable in its %WEBPREFSTOPIC% topic:
162             		* ==Set <nop>NOSEARCHALL = on==
163             	1. *Add* ==view== to the list of authenticated scripts in the =.htaccess= file.
164             
165             %H% This method only works if the ==view== script is authenticated, which means that all Users have to login, even for read-only access. (An open guest account, like Main.TWikiGuest, can get around this, allowing anyone to login to a common account with, for example, view-only access for public webs.) TWikiInstallationGuide has more on Basic Authentication, using the ==.htaccess== file.
166             
167             ---++++ Authenticate and Restricting Selected Webs Only
168             
169 rizwank 1.1 Use the following setup to provide unrestricted viewing access to open webs, with authentication only on selected webs:
170             
171             	1. *Restrict* view access to selected Users and Groups. Set one or both of these variables in its %WEBPREFSTOPIC% topic:
172             		* ==Set <nop>DENYWEBVIEW = &lt; list of Users and Groups &gt;==
173             		* ==Set <nop>ALLOWWEBVIEW = &lt; list of Users and Groups &gt;==
174             		* __Note:__ =DENYWEBVIEW= is evaluated before =ALLOWWEBVIEW=. Access is denied if the authenticated person is in the =DENYWEBVIEW= list, or not in the =ALLOWWEBVIEW= list. Access is granted in case =DENYWEBVIEW= and =ALLOWWEBVIEW= is not defined.
175             	1. *Hide* the web from an "all webs" search. Enable this restriction with the ==NOSEARCHALL== variable in its %WEBPREFSTOPIC% topic:
176             		* ==Set <nop>NOSEARCHALL = on==
177             	1. *Enable* the ==$doRememberRemoteUser== flag in ==lib/TWiki.cfg== as described in TWikiUserAuthentication. %WIKITOOLNAME% will now remember the IP address of an authenticated user. 
178             	1. *Copy* the ==view== script to ==viewauth== (or better, create a symbolic link) 
179             	1. *Add* ==viewauth== to the list of authenticated scripts in the =.htaccess= file. The ==view== script should not be listed in the =.htaccess= file.
180             
181             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.
182             
183             %X% *Authenticating webs is not very secure*, as there is a way to circumvent the read access restriction. It can be useful in certain situations - for example, to simplify site organization and clutter, by hiding low traffic webs - but is not recommended for securing sensitive content.
184             
185             
186             ---++ Hiding Control Settings
187             
188             %T% To hide access control settings from normal browser viewing, place them in comment markers.
189             
190 rizwank 1.1 <style="background-color:#f5f5f5">
191             =&lt;!--= <br />
192             =&nbsp;  * Set <nop>DENYTOPICCHANGE = Main.<nop>SomeGroup= <br />
193             =--&gt;=
194             </style>
195             
196             #SuperAdminGroup
197             ---++ The <nop>SuperAdminGroup
198             
199             By mistyping a user or group name in the ALLOWTOPICCHANGE setting, it's possible to lock a topic so that no-one can edit it from a browser. To avoid this, you can create Web-based *superusers*:
200             	* Set the ==$superAdminGroup== variable in ==lib/TWiki.cfg== to the name of a group of Users who are always allowed to edit/view topics.
201             <blockquote style="background-color:#f5f5f5">
202             <verbatim>
203             $superAdminGroup = "TWikiAdminGroup";
204             </verbatim>
205             </blockquote>
206             	* The default setting is not to have superusers.
207             
208             -- TWiki:Main.PeterThoeny - 04 May 2002 %BR%
209             -- TWiki:Main.MikeMannix - 12 May 2002 
210             
211 rizwank 1.1 %STOPINCLUDE%
212             

Rizwan Kassim
Powered by
ViewCVS 0.9.2