head	1.31;
access;
symbols;
locks; strict;
comment	@# @;


1.31
date	2006.04.01.05.55.11;	author TWikiContributor;	state Exp;
branches;
next	1.30;

1.30
date	2006.02.01.12.01.18;	author TWikiContributor;	state Exp;
branches;
next	1.29;

1.29
date	2004.08.15.08.47.11;	author PeterThoeny;	state Exp;
branches;
next	1.28;

1.28
date	2003.04.14.07.19.22;	author PeterThoeny;	state Exp;
branches;
next	1.27;

1.27
date	2002.12.29.02.18.11;	author PeterThoeny;	state Exp;
branches;
next	1.26;

1.26
date	2002.05.29.15.36.00;	author PeterThoeny;	state Exp;
branches;
next	1.25;

1.25
date	2002.05.29.07.48.15;	author PeterThoeny;	state Exp;
branches;
next	1.24;

1.24
date	2002.05.12.11.34.00;	author MikeMannix;	state Exp;
branches;
next	1.23;

1.23
date	2002.05.04.06.57.54;	author PeterThoeny;	state Exp;
branches;
next	1.22;

1.22
date	2002.04.02.00.04.19;	author MikeMannix;	state Exp;
branches;
next	1.21;

1.21
date	2002.03.20.11.15.44;	author MikeMannix;	state Exp;
branches;
next	1.20;

1.20
date	2001.12.02.09.02.00;	author MikeMannix;	state Exp;
branches;
next	1.19;

1.19
date	2001.09.16.05.05.21;	author MikeMannix;	state Exp;
branches;
next	1.18;

1.18
date	2001.09.14.08.11.42;	author PeterThoeny;	state Exp;
branches;
next	1.17;

1.17
date	2001.09.12.07.32.21;	author MikeMannix;	state Exp;
branches;
next	1.16;

1.16
date	2001.09.07.10.06.13;	author MikeMannix;	state Exp;
branches;
next	1.15;

1.15
date	2001.09.07.07.26.07;	author MikeMannix;	state Exp;
branches;
next	1.14;

1.14
date	2001.09.05.07.16.35;	author MikeMannix;	state Exp;
branches;
next	1.13;

1.13
date	2001.09.04.04.07.40;	author MikeMannix;	state Exp;
branches;
next	1.12;

1.12
date	2001.08.31.12.18.50;	author MikeMannix;	state Exp;
branches;
next	1.11;

1.11
date	2001.08.30.22.17.20;	author MikeMannix;	state Exp;
branches;
next	1.10;

1.10
date	2001.08.29.09.54.36;	author MikeMannix;	state Exp;
branches;
next	1.9;

1.9
date	2001.08.07.15.41.20;	author JohnTalintyre;	state Exp;
branches;
next	1.8;

1.8
date	2001.06.08.06.06.45;	author PeterThoeny;	state Exp;
branches;
next	1.7;

1.7
date	2001.03.16.08.38.35;	author PeterThoeny;	state Exp;
branches;
next	1.6;

1.6
date	2001.02.26.20.28.42;	author PeterThoeny;	state Exp;
branches;
next	1.5;

1.5
date	2001.01.21.07.50.19;	author PeterThoeny;	state Exp;
branches;
next	1.4;

1.4
date	2001.01.21.01.21.14;	author PeterThoeny;	state Exp;
branches;
next	1.3;

1.3
date	2000.12.14.03.01.38;	author PeterThoeny;	state Exp;
branches;
next	1.2;

1.2
date	2000.11.08.08.15.37;	author PeterThoeny;	state Exp;
branches;
next	1.1;

1.1
date	2000.10.29.05.25.13;	author PeterThoeny;	state Exp;
branches;
next	;


desc
@none
@


1.31
log
@buildrelease
@
text
@%META:TOPICINFO{author="TWikiContributor" date="1131718988" format="1.1" version="31"}%
%TOC%
%STARTINCLUDE%

---# TWiki Access Control

_Restricting read and write access to topics and webs, by Users and groups_

TWiki Access Control allows you restrict access to single topics and entire webs, by individual user and by user Groups. Access control, combined with TWikiUserAuthentication, lets you easily create and manage an extremely flexible, fine-grained privilege system.

__%T% Tip:__ TWiki:TWiki.TWikiAccessControlSupplement on TWiki.org has additional documentation on access control.

#ImportantConsideration
---++ An Important Control Consideration

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 great care - the more restrictions, the less Wiki in the mix. Experience shows that _unrestricted write access_ works very well because:
   * *Peer influence* is enough to ensure that only relevant content is posted.
   * *Peer editing* - the ability for anyone to rearrange all content on a page - keeps topics focused.
   * In TWiki, content is transparently preserved under *revision control*:
      * Edits can be undone by the %MAINWEB%.TWikiAdminGroup (the default administrators group; see [[#ManagingGroups]]).
      * Users are encouraged to edit and refactor (condense a long topic), since there's a safety net.
As a *collaboration guideline*:
   * Create broad-based Groups (for more and varied input), and...
   * Avoid creating view-only Users (if you can read it, you should be able to contribute to it).

---++ Permissions settings of the webs on this TWiki site
%INCLUDE{SitePermissions}%

__Note:__ Above table comes from SitePermissions

---++ Authentication vs. Access Control

*Authentication:* Identifies who a user is based on a login procedure. See TWikiUserAuthentication.

*Access control:* Restrict access to content based on users and groups once a user is identified.

---++ Users and Groups

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. 

---+++ Managing Users

A user can create an account in TWikiRegistration. The following actions are performed:
   * WikiName and encrypted password are recorded using the password manager if authentication is enabled.
   * A confirmation e-mail is sent to the user.
   * A user home page with the WikiName of the user is created in the %MAINWEB% web.
   * The user is added to the %MAINWEB%.%WIKIUSERSTOPIC% topic.

The default visitor name is %MAINWEB%.TWikiGuest. This is the non-authenticated user.

#ManagingGroups
---+++ Managing Groups

Groups are defined by group topics located in the ==%MAINWEB%== web, such as the %MAINWEB%.TWikiAdminGroup. To create a new group, visit  %MAINWEB%.TWikiGroups and enter the name of the new group ending in ==Group== into the "new group" form field. This will create a new group topic with two important settings:
   * ==Set <nop>GROUP = &lt; list of Users and/or Groups &gt;==
   * ==Set <nop>ALLOWTOPICCHANGE = &lt; list of Users and/or Groups &gt;==

The GROUP setting is a comma-separated list of users and/or other groups. Example:
   * ==Set GROUP = %MAINWEB%.<nop>SomeUser, %MAINWEB%.<nop>OtherUser, %MAINWEB%.<nop>SomeGroup==

The ALLOWTOPICCHANGE setting 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:
   * ==Set ALLOWTOPICCHANGE = %MAINWEB%.<nop>TWikiAdminGroup==

__%X% Note:__ TWiki has strict formatting rules. Make sure you have three spaces, an asterisk, and an extra space in front of any access control rule.

#SuperAdminGroup
---+++ The Super Admin Group

By mistyping a user or group name in the settings, it's possible to lock a topic so that no-one can edit it from a browser. To avoid this, add the WikiNames of registered administrators to the super admin group topic called ==TWikiAdminGroup==. The name of this topic is defined by the {SuperAdminGroup} configure setting. Example group setting:
   * ==Set <nop>GROUP= <nop>%MAINWEB%.ElizabethWindsor, <nop>%MAINWEB%.TonyBlair==

---++ Restricting Access

You can define who is allowed to read or write to a web or a topic. Note that some plugins may not respect access permissions.

   * Restricting VIEW blocks viewing and searching of content.
   * Restricting CHANGE blocks creating new topics, changing topics or attaching files.
   * Restricting RENAME controls who is allowed to rename, move or delete a topic.
      * To rename, move or delete a topic, the user also also needs VIEW and CHANGE permission.  They also need CHANGE access to change references in any referring topics (though the rename can proceed without this access), and CHANGE access to the target topic.
   * Restricting MANAGE controls access to certain management functions, such as 'create web'. It must be set in the %TWIKIWEB% web.

---+++ Controlling access to a Web

You can define restrictions of who is allowed to view a <nop>%WIKITOOLNAME% web. You can restrict access to certain webs to selected Users and Groups, by:

   * *authenticating all webs and restricting selected webs:* Topic access in all webs is authenticated, and selected webs have restricted access.
   * *authenticating and restricting selected webs only:* Provide unrestricted viewing access to open webs, with authentication and restriction only on selected webs.

   * You can define these settings in the %WEBPREFSTOPIC% topic, preferable towards the end of the topic:
      * ==Set <nop>DENYWEBVIEW = &lt; comma-delimited list of Users and Groups &gt;==
      * ==Set <nop>ALLOWWEBVIEW = &lt; comma-delimited list of Users and Groups &gt;==
      * ==Set <nop>DENYWEBCHANGE = &lt; comma-delimited list of Users and Groups &gt;==
      * ==Set <nop>ALLOWWEBCHANGE = &lt; comma-delimited list of Users and Groups &gt;==
      * ==Set <nop>DENYWEBRENAME = &lt; comma-delimited list of Users and Groups &gt;==
      * ==Set <nop>ALLOWWEBRENAME = &lt; comma-delimited list of Users and Groups &gt;==

*Be careful* with empty values for any of these. In older versions of TWiki,
   * ==Set <nop>ALLOWWEBVIEW = <nop>==
meant the same as not setting it at all. However since TWiki Dakar release, it means _allow noone access_ i.e. prevent anyone from viewing the web. Similarly
   * ==Set <nop>DENYWEBVIEW = <nop>==
now means _do not deny anyone the right to view this web_. See "How TWiki evaluates ALLOW/DENY settings" below for more on this.

---+++ Controlling access to a Topic

   * You can define these settings in the %WEBPREFSTOPIC% topic, preferable towards the end of the topic:
      * ==Set <nop>DENYTOPICVIEW = &lt; comma-delimited list of Users and Groups &gt;==
      * ==Set <nop>ALLOWTOPICVIEW = &lt; comma-delimited list of Users and Groups &gt;==
      * ==Set <nop>DENYTOPICCHANGE = &lt; comma-delimited list of Users and Groups &gt;==
      * ==Set <nop>ALLOWTOPICCHANGE = &lt; comma-delimited list of Users and Groups &gt;==
      * ==Set <nop>DENYTOPICRENAME = &lt; comma-delimited list of Users and Groups &gt;==
      * ==Set <nop>ALLOWTOPICRENAME = &lt; comma-delimited list of Users and Groups &gt;==

Remember when opening up access to specific topics within a restricted web that other topics in the web - for example, the WebLeftBar - may also be accessed when viewing the topics. The message you get when you are denied access should tell you what topic you were not permitted to access.

*Be careful* with empty values for any of these. In older versions of TWiki,
   * ==Set <nop>ALLOWTOPICVIEW = <nop>==
meant the same as not setting it at all. However since TWiki Dakar release, it means _allow no-one access_ i.e. prevent anyone from viewing the topic. Similarly
   * ==Set <nop>DENYTOPICVIEW = <nop>==
now means _do not deny anyone the right to view this topic_. See "How TWiki evaluates ALLOW/DENY settings" below for more on this.

---+++ Controlling access to Attachments

Attachments are referred to directly, and are not normally indirected via TWiki scripts. This means that the above instructions for access control will _not_ apply to attachments. It is possible that someone may inadvertently publicise a URL that they expected to be access-controlled.

The easiest way to apply the same access control rules for attachments as apply to topics is to use the Apache =mod_rewrite= module, and configure your webserver to redirect accesses to attachments to the TWiki =viewfile= script. For example,

<verbatim>
  ScriptAlias /twiki/bin/ /filesystem/path/to/twiki/bin/
  Alias /twiki/pub/       /filesystem/path/to/twiki/pub/

  RewriteEngine on
  RewriteRule ^/twiki/pub/TWiki/(.*)$ /twiki/pub/TWiki/$1 [L,PT]
  RewriteRule ^/twiki/pub/([^\/]+)/([^\/]+)/([^\/]+)$ /twiki/bin/viewfile/$1/$2?filename=$3 [L,PT]
</verbatim>

That way all the controls that apply to the topic also apply to attachments to the topic. Other types of webserver have similar support.

__Note:__ Images embedded in topics will load much slower since each image will be delivered by the =viewfile= script.

---+++ How TWiki evaluates ALLOW/DENY settings

When deciding whether to grant access, TWiki evaluates the following rules in order (read from the top of the list; if the logic arrives at *PERMITTED* or *DENIED* that applies immediately and no more rules are applied). You need to read the rules bearing in mind that VIEW, CHANGE and RENAME access may be granted/denied separately.
   1 If the user is a [[#SuperAdminGroup][super-user]]
      * access is *PERMITTED*.
   1 If DENYTOPIC is set to a list of wikinames
      * people in the list will be *DENIED*.
   1 If DENYTOPIC is set to _empty_ ( i.e. <tt>Set DENYTOPIC =</tt> )
      * access is *PERMITTED* _i.e_ no-one is denied access to this topic
   1 If ALLOWTOPIC is set
      1 people in the list are *PERMITTED*
      1 everyone else is *DENIED*
         * Note that this means that setting ALLOWTOPIC to empty _denies access to everyone except admins_ (unless DENYTOPIC is also set to empty, as described above)
   1 If DENYWEB is set to a list of wikiname
      * people in the list are *DENIED* access
   1 If ALLOWWEB is set to a list of wikinames
      * people in the list will be *PERMITTED*
      * everyone else will be *DENIED*
         * Note that setting ALLOWWEB to empty _denies access to everyone except admins_
   1 If you got this far, access is *PERMITTED*

---++ Access Control quick recipes

---+++ Obfuscating Webs

Another way of hiding webs is to keep them hidden by not publishing the URL and by preventing the ==all webs== search option from accessing obfuscated webs. Do so by enabling the ==NOSEARCHALL== variable in %WEBPREFSTOPIC%:
   * ==Set <nop>NOSEARCHALL = on==

This setup can be useful to hide a new web until content its ready for deployment, or to hide view access restricted webs.

__%X% Note:__ Obfuscating a web without view access control is *very* insecure, as anyone who knows the URL can access the web.

---+++ Authenticate all Webs and Restrict Selected Webs

Use the following setup to authenticate users for topic viewing in all webs and to restrict access to selected webs. Requires TWikiUserAuthentication to be enabled.

   1. *Restrict* view access to selected Users and Groups. Set one or both of these variables in its %WEBPREFSTOPIC% topic:
      * ==Set <nop>DENYWEBVIEW = &lt; list of Users and Groups &gt;==
      * ==Set <nop>ALLOWWEBVIEW = &lt; list of Users and Groups &gt;==
      * __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.

---+++ Authenticate and Restrict Selected Webs Only

Use the following setup to provide unrestricted viewing access to open webs, with authentication only on selected webs. Requires TWikiUserAuthentication to be enabled.

   1. *Restrict* view access to selected Users and Groups. Set one or both of these variables in its %WEBPREFSTOPIC% topic:
      * ==Set <nop>DENYWEBVIEW = &lt; list of Users and Groups &gt;==
      * ==Set <nop>ALLOWWEBVIEW = &lt; list of Users and Groups &gt;==
      * __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.

---+++ Hide Control Settings

__%T% Tip:__ To hide access control settings from normal browser viewing, place them in HTML comment markers.

<blockquote>
==&lt;!--== <br />
==&nbsp;  * Set <nop>DENYTOPICCHANGE = %MAINWEB%.<nop>SomeGroup== <br />
==--&gt;==
</blockquote>

%STOPINCLUDE%

__Related Topics:__ AdminDocumentationCategory, TWikiUserAuthentication, TWiki:TWiki.TWikiAccessControlSupplement

-- __Contributors:__ TWiki:Main.PeterThoeny, TWiki:Main.MikeMannix, TWiki:Main.CrawfordCurrie
@


1.30
log
@buildrelease
@
text
@d1 1
a1 1
%META:TOPICINFO{author="TWikiContributor" date="1131718988" format="1.1" version="30"}%
d13 1
d17 5
a21 5
	* *Peer influence* is enough to ensure that only relevant content is posted.
	* *Peer editing* - the ability for anyone to rearrange all content on a page - keeps topics focused.
	* In TWiki, content is transparently preserved under *revision control*:
		* Edits can be undone by the %MAINWEB%.TWikiAdminGroup (the default administrators group; see [[#ManagingGroups]]).
		* Users are encouraged to edit and refactor (condense a long topic), since there's a safety net.
d23 2
a24 2
	* Create broad-based Groups (for more and varied input), and...
	* Avoid creating view-only Users (if you can read it, you should be able to contribute to it).
d44 4
a47 4
	* WikiName and encrypted password are recorded using the password manager if authentication is enabled.
	* A confirmation e-mail is sent to the user.
	* A user home page with the WikiName of the user is created in the %MAINWEB% web.
	* The user is added to the %MAINWEB%.%WIKIUSERSTOPIC% topic.
d55 2
a56 2
	* ==Set <nop>GROUP = &lt; list of Users and/or Groups &gt;==
	* ==Set <nop>ALLOWTOPICCHANGE = &lt; list of Users and/or Groups &gt;==
d59 1
a59 1
	* ==Set GROUP = %MAINWEB%.<nop>SomeUser, %MAINWEB%.<nop>OtherUser, %MAINWEB%.<nop>SomeGroup==
d62 1
a62 1
	* ==Set ALLOWTOPICCHANGE = %MAINWEB%.<nop>TWikiAdminGroup==
d70 1
a70 1
	* ==Set <nop>GROUP= <nop>%MAINWEB%.ElizabethWindsor, <nop>%MAINWEB%.TonyBlair==
d76 5
a80 5
	* Restricting VIEW blocks viewing and searching of content.
	* Restricting CHANGE blocks creating new topics, changing topics or attaching files.
	* Restricting RENAME controls who is allowed to rename, move or delete a topic.
		* To rename, move or delete a topic, the user also also needs VIEW and CHANGE permission.  They also need CHANGE access to change references in any referring topics (though the rename can proceed without this access), and CHANGE access to the target topic.
	* Restricting MANAGE controls access to certain management functions, such as 'create web'. It must be set in the %TWIKIWEB% web.
d86 2
a87 2
	* *authenticating all webs and restricting selected webs:* Topic access in all webs is authenticated, and selected webs have restricted access.
	* *authenticating and restricting selected webs only:* Provide unrestricted viewing access to open webs, with authentication and restriction only on selected webs.
d89 7
a95 7
	* You can define these settings in the %WEBPREFSTOPIC% topic, preferable towards the end of the topic:
		* ==Set <nop>DENYWEBVIEW = &lt; comma-delimited list of Users and Groups &gt;==
		* ==Set <nop>ALLOWWEBVIEW = &lt; comma-delimited list of Users and Groups &gt;==
		* ==Set <nop>DENYWEBCHANGE = &lt; comma-delimited list of Users and Groups &gt;==
		* ==Set <nop>ALLOWWEBCHANGE = &lt; comma-delimited list of Users and Groups &gt;==
		* ==Set <nop>DENYWEBRENAME = &lt; comma-delimited list of Users and Groups &gt;==
		* ==Set <nop>ALLOWWEBRENAME = &lt; comma-delimited list of Users and Groups &gt;==
d98 1
a98 1
	* ==Set <nop>ALLOWWEBVIEW = <nop>==
d100 1
a100 1
	* ==Set <nop>DENYWEBVIEW = <nop>==
d105 7
a111 7
	* You can define these settings in the %WEBPREFSTOPIC% topic, preferable towards the end of the topic:
		* ==Set <nop>DENYTOPICVIEW = &lt; comma-delimited list of Users and Groups &gt;==
		* ==Set <nop>ALLOWTOPICVIEW = &lt; comma-delimited list of Users and Groups &gt;==
		* ==Set <nop>DENYTOPICCHANGE = &lt; comma-delimited list of Users and Groups &gt;==
		* ==Set <nop>ALLOWTOPICCHANGE = &lt; comma-delimited list of Users and Groups &gt;==
		* ==Set <nop>DENYTOPICRENAME = &lt; comma-delimited list of Users and Groups &gt;==
		* ==Set <nop>ALLOWTOPICRENAME = &lt; comma-delimited list of Users and Groups &gt;==
d116 1
a116 1
	* ==Set <nop>ALLOWTOPICVIEW = <nop>==
d118 1
a118 1
	* ==Set <nop>DENYTOPICVIEW = <nop>==
d129 1
a129 1
  Alias /twiki/pub/		 /filesystem/path/to/twiki/pub/
d143 17
a159 17
	1 If the user is a [[#SuperAdminGroup][super-user]]
		* access is *PERMITTED*.
	1 If DENYTOPIC is set to a list of wikinames
		* people in the list will be *DENIED*.
	1 If DENYTOPIC is set to _empty_ ( i.e. <tt>Set DENYTOPIC =</tt> )
		* access is *PERMITTED* _i.e_ no-one is denied access to this topic
	1 If ALLOWTOPIC is set
		1 people in the list are *PERMITTED*
		1 everyone else is *DENIED*
			* Note that this means that setting ALLOWTOPIC to empty _denies access to everyone except admins_ (unless DENYTOPIC is also set to empty, as described above)
	1 If DENYWEB is set to a list of wikiname
		* people in the list are *DENIED* access
	1 If ALLOWWEB is set to a list of wikinames
		* people in the list will be *PERMITTED*
		* everyone else will be *DENIED*
			* Note that setting ALLOWWEB to empty _denies access to everyone except admins_
	1 If you got this far, access is *PERMITTED*
d166 1
a166 1
	* ==Set <nop>NOSEARCHALL = on==
d170 1
a170 1
__%X% Note:__ Obfuscating a web without view access control is very insecure, as anyone who knows the URL can access the web.
d176 4
a179 6
	1. *Restrict* view access to selected Users and Groups. Set one or both of these variables in its %WEBPREFSTOPIC% topic:
		* ==Set <nop>DENYWEBVIEW = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWWEBVIEW = &lt; list of Users and Groups &gt;==
		* __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.
	1. *Hide* the web from an "all webs" search. Enable this restriction with the ==NOSEARCHALL== variable in its %WEBPREFSTOPIC% topic:
		* ==Set <nop>NOSEARCHALL = on==
d185 4
a188 6
	1. *Restrict* view access to selected Users and Groups. Set one or both of these variables in its %WEBPREFSTOPIC% topic:
		* ==Set <nop>DENYWEBVIEW = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWWEBVIEW = &lt; list of Users and Groups &gt;==
		* __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.
	1. *Hide* the web from an "all webs" search. Enable this restriction with the ==NOSEARCHALL== variable in its %WEBPREFSTOPIC% topic:
		* ==Set <nop>NOSEARCHALL = on==
@


1.29
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="PeterThoeny" date="1092559631" format="1.0" version="1.29"}%
d9 3
a11 1
TWikiAccessControl allows you restrict access to single topics and entire webs, by individual user and by user Groups, in three areas: view; edit &amp; attach; and rename/move/delete. Access control, combined with TWikiUserAuthentication, lets you easily create and manage an extremely flexible, fine-grained privilege system.
d15 1
a15 2
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:

d17 1
a17 3

	* *Peer editing* - the ability for anyone to rearrange all content on a page - keeps topics focussed.

a20 1

a21 1

d25 5
d43 1
a43 2

	* WikiName and encrypted password are recorded in =.htpasswd= if authentication is enabled.
a47 2
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.

d53 3
a55 10
Groups are defined by group topics created in the ==%MAINWEB%== web, like the %MAINWEB%.TWikiAdminGroup. To create a new group:
	1. ==Edit== %MAINWEB%.TWikiGroups by entering a new topic with a name that ends in ==Group==. Example:
		* ==<nop>SomeGroup==
	1. *Set Preferences* for two Variables in the new group topic:
		* ==Set <nop>GROUP = &lt; list of Users and/or Groups &gt;==
		* ==Set <nop>ALLOWTOPICCHANGE = &lt; list of Users and/or Groups &gt;==
		* The GROUP variable is a comma-separated list of Users and/or other Groups. Example:
			* ==Set GROUP = %MAINWEB%.<nop>SomeUser, %MAINWEB%.<nop>OtherUser, %MAINWEB%.<nop>SomeGroup==
		* 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:
		* ==Set ALLOWTOPICCHANGE = %MAINWEB%.<nop>TWikiAdminGroup==
d57 2
a58 1
---++ Restricting Write Access
d60 2
a61 1
You can define who is allowed to make changes to a web or a topic. 
d63 1
a63 1
---+++ Deny Editing by Topic
d65 2
a66 4
Denying editing of a topic also restricts file attachment; both privileges are assigned together.
	* Define one or both of these variables in a topic, preferably at the end of the page:
		* ==Set <nop>DENYTOPICCHANGE = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWTOPICCHANGE = &lt; list of Users and Groups &gt;==
d68 2
a69 2
	* DENYTOPICCHANGE defines Users or Groups that *are not* allowed to make changes to the topic, with a comma-delimited list. Example:
		* ==Set <nop>DENYTOPICCHANGE = %MAINWEB%.<nop>SomeBadBoy, %MAINWEB%.<nop>SomeBadGirl, %MAINWEB%.<nop>SomeHackerGroup==
d71 1
a71 2
	* 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:
		* ==Set <nop>ALLOWTOPICCHANGE = %MAINWEB%.<nop>SomeGoodGuy, %MAINWEB%.<nop>SomeGoodGirl, %MAINWEB%.<nop>TWikiAdminGroup==
d73 1
a73 1
	* 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.
d75 5
a79 1
---+++ Deny Editing by Web
d81 1
a81 1
Restricting web-level editing blocks creating new topics, changing topics or attaching files.
d83 1
a83 3
	* Define one or both of these variable in the %WEBPREFSTOPIC% topic:
		* ==Set <nop>DENYWEBCHANGE = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWWEBCHANGE = &lt; list of Users and Groups &gt;==
d85 2
a86 3
The same rules apply as for restricting topics, with these additions:
	* DENYTOPICCHANGE (in topic) overrides DENYWEBCHANGE (in <nop>%WEBPREFSTOPIC%)
	* ALLOWTOPICCHANGE (in topic) overrides ALLOWWEBCHANGE (in <nop>%WEBPREFSTOPIC%)
d88 31
a118 1
---++ Restricting Rename Access
d120 1
a120 1
You can define who is allowed to rename, move or delete a topic, or rename a web.
d122 1
a122 1
---+++ Deny Renaming by Topic
d124 1
a124 1
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.
d126 3
a128 3
	* Define one or both of these variables in a topic, preferably at the end of the topic:
		* ==Set <nop>DENYTOPICRENAME = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWTOPICRENAME = &lt; list of Users and Groups &gt;==
d130 4
a133 9
	* DENYTOPICCRENAME defines Users or Groups that *are not* allowed to rename the topic. It is a comma delimited list of Users and Groups. Example:
		* ==Set <nop>DENYTOPICRENAME = %MAINWEB%.<nop>SomeBadBoy, %MAINWEB%.<nop>SomeBadGirl, %MAINWEB%.<nop>SomeHackerGroup==

	* ALLOWTOPICRENAME defines Users or Groups that *are* allowed to rename the topic. It is a comma delimited list of Users and Groups. Example:
		* ==Set <nop>ALLOWTOPICRENAME = %MAINWEB%.<nop>SomeGoodGuy, %MAINWEB%.<nop>SomeGoodGirl, %MAINWEB%.<nop>TWikiAdminGroup==

	* 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.

---+++ Deny Renaming by Web
d135 1
a135 1
You can define restrictions of who is allowed to rename a %WIKITOOLNAME% web.
d137 1
a137 3
	* Define one or both of these variable in the %WEBPREFSTOPIC% topic:
		* ==Set <nop>DENYWEBRENAME = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWWEBRENAME = &lt; list of Users and Groups &gt;==
d139 1
a139 3
The same rules apply as for topics, with these additions:
	* DENYTOPICRENAME (in topic) overrides DENYWEBRENAME (in <nop>%WEBPREFSTOPIC%)
	* ALLOWTOPICRENAME (in topic) overrides ALLOWWEBRENAME (in <nop>%WEBPREFSTOPIC%)
d141 18
a158 1
---++ Restricting Read Access
d160 1
a160 1
You can define who is allowed to see a web.
d162 1
a162 1
---+++ Deny Viewing by Topic
d164 1
a164 13
%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.

---+++ Deny Viewing by Web

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:

	* *obfuscating webs:* Insecure but handy method to hide new webs until content is ready for deployment.
	* *authenticating all webs and restricting selected webs:* Topic access in all webs is authenticated, and selected webs have restricted access.
	* *authenticating and restricting selected webs only:* Provide unrestricted viewing access to open webs, with authentication and restriction only on selected webs.

---++++ Obfuscate Webs

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%:
d167 1
a167 1
This setup can be useful to hide a new web until content its ready for deployment.
d169 1
a169 1
%X% *Obfuscating webs is insecure*, as anyone who knows the URL can access the web.
d171 1
a171 1
---++++ Authenticate all Webs and Restrict Selected Webs
d173 1
a173 1
Use the following setup to authenticate users for topic viewing in all webs and to restrict access to selected webs:
a180 1
	1. *Add* ==view== to the list of authenticated scripts in the =.htaccess= file.
d182 1
a182 1
%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.
d184 1
a184 3
---++++ Authenticate and Restricting Selected Webs Only

Use the following setup to provide unrestricted viewing access to open webs, with authentication only on selected webs:
a191 5
	1. *Enable* the ==$doRememberRemoteUser== flag in ==lib/TWiki.cfg== as described in TWikiUserAuthentication. %WIKITOOLNAME% will now remember the IP address of an authenticated user. 
	1. *Copy* the ==view== script to ==viewauth== (or better, create a symbolic link) 
	1. *Add* ==viewauth== to the list of authenticated scripts in the =.htaccess= file. The ==view== script should not be listed in the =.htaccess= file.

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.
d193 1
a193 1
%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.
d195 1
d197 4
a200 19
---++ Hiding Control Settings

%T% To hide access control settings from normal browser viewing, place them in comment markers.

<style="background-color:#f5f5f5">
=&lt;!--= <br />
=&nbsp;  * Set <nop>DENYTOPICCHANGE = Main.<nop>SomeGroup= <br />
=--&gt;=
</style>

#SuperAdminGroup
---++ The <nop>SuperAdminGroup

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*:
	* Set the ==$superAdminGroup== variable in ==lib/TWiki.cfg== to the name of a group of Users who are always allowed to edit/view topics.
<blockquote style="background-color:#f5f5f5">
<verbatim>
$superAdminGroup = "TWikiAdminGroup";
</verbatim>
a201 1
	* The default setting is not to have superusers.
d203 1
a203 2
-- TWiki:Main.PeterThoeny - 04 May 2002 %BR%
-- TWiki:Main.MikeMannix - 12 May 2002 
d205 1
a205 1
%STOPINCLUDE%
d207 1
@


1.28
log
@none
@
text
@d1 212
a212 211
%META:TOPICINFO{author="PeterThoeny" date="1050304762" format="1.0" version="1.28"}%
%TOC%
%STARTINCLUDE%

---# TWiki Access Control

_Restricting read and write access to topics and webs, by Users and groups_

TWikiAccessControl allows you restrict access to single topics and entire webs, by individual user and by user Groups, in three areas: view; edit &amp; attach; and rename/move/delete. Access control, combined with TWikiUserAuthentication, lets you easily create and manage an extremely flexible, fine-grained privilege system.

---++ An Important Control Consideration

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:

	* *Peer influence* is enough to ensure that only relevant content is posted.

	* *Peer editing* - the ability for anyone to rearrange all content on a page - keeps topics focussed.

	* In TWiki, content is transparently preserved under *revision control*:
		* Edits can be undone by the %MAINWEB%.TWikiAdminGroup (the default administrators group; see [[#ManagingGroups]]).
		* Users are encouraged to edit and refactor (condense a long topic), since there's a safety net.

As a *collaboration guideline*:

	* Create broad-based Groups (for more and varied input), and...
	* Avoid creating view-only Users (if you can read it, you should be able to contribute to it).

---++ Authentication vs. Access Control

*Authentication:* Identifies who a user is based on a login procedure. See TWikiUserAuthentication.

*Access control:* Restrict access to content based on users and groups once a user is identified.

---++ Users and Groups

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. 

---+++ Managing Users

A user can create an account in TWikiRegistration. The following actions are performed:

	* WikiName and encrypted password are recorded in =.htpasswd= if authentication is enabled.
	* A confirmation e-mail is sent to the user.
	* A user home page with the WikiName of the user is created in the %MAINWEB% web.
	* The user is added to the %MAINWEB%.%WIKIUSERSTOPIC% topic.

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.

The default visitor name is %MAINWEB%.TWikiGuest. This is the non-authenticated user.

#ManagingGroups
---+++ Managing Groups

Groups are defined by group topics created in the ==%MAINWEB%== web, like the %MAINWEB%.TWikiAdminGroup. To create a new group:
	1. ==Edit== %MAINWEB%.TWikiGroups by entering a new topic with a name that ends in ==Group==. Example:
		* ==<nop>SomeGroup==
	1. *Set Preferences* for two Variables in the new group topic:
		* ==Set <nop>GROUP = &lt; list of Users and/or Groups &gt;==
		* ==Set <nop>ALLOWTOPICCHANGE = &lt; list of Users and/or Groups &gt;==
		* The GROUP variable is a comma-separated list of Users and/or other Groups. Example:
			* ==Set GROUP = %MAINWEB%.<nop>SomeUser, %MAINWEB%.<nop>OtherUser, %MAINWEB%.<nop>SomeGroup==
		* 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:
		* ==Set ALLOWTOPICCHANGE = %MAINWEB%.<nop>TWikiAdminGroup==

---++ Restricting Write Access

You can define who is allowed to make changes to a web or a topic. 

---+++ Deny Editing by Topic

Denying editing of a topic also restricts file attachment; both privileges are assigned together.
	* Define one or both of these variables in a topic, preferably at the end of the page:
		* ==Set <nop>DENYTOPICCHANGE = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWTOPICCHANGE = &lt; list of Users and Groups &gt;==

	* DENYTOPICCHANGE defines Users or Groups that *are not* allowed to make changes to the topic, with a comma-delimited list. Example:
		* ==Set <nop>DENYTOPICCHANGE = %MAINWEB%.<nop>SomeBadBoy, %MAINWEB%.<nop>SomeBadGirl, %MAINWEB%.<nop>SomeHackerGroup==

	* 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:
		* ==Set <nop>ALLOWTOPICCHANGE = %MAINWEB%.<nop>SomeGoodGuy, %MAINWEB%.<nop>SomeGoodGirl, %MAINWEB%.<nop>TWikiAdminGroup==

	* 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.

---+++ Deny Editing by Web

Restricting web-level editing blocks creating new topics, changing topics or attaching files.

	* Define one or both of these variable in the %WEBPREFSTOPIC% topic:
		* ==Set <nop>DENYWEBCHANGE = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWWEBCHANGE = &lt; list of Users and Groups &gt;==

The same rules apply as for restricting topics, with these additions:
	* DENYTOPICCHANGE (in topic) overrides DENYWEBCHANGE (in <nop>%WEBPREFSTOPIC%)
	* ALLOWTOPICCHANGE (in topic) overrides ALLOWWEBCHANGE (in <nop>%WEBPREFSTOPIC%)

---++ Restricting Rename Access

You can define who is allowed to rename, move or delete a topic, or rename a web.

---+++ Deny Renaming by Topic

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.

	* Define one or both of these variables in a topic, preferably at the end of the topic:
		* ==Set <nop>DENYTOPICRENAME = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWTOPICRENAME = &lt; list of Users and Groups &gt;==

	* DENYTOPICCRENAME defines Users or Groups that *are not* allowed to rename the topic. It is a comma delimited list of Users and Groups. Example:
		* ==Set <nop>DENYTOPICRENAME = %MAINWEB%.<nop>SomeBadBoy, %MAINWEB%.<nop>SomeBadGirl, %MAINWEB%.<nop>SomeHackerGroup==

	* ALLOWTOPICRENAME defines Users or Groups that *are* allowed to rename the topic. It is a comma delimited list of Users and Groups. Example:
		* ==Set <nop>ALLOWTOPICRENAME = %MAINWEB%.<nop>SomeGoodGuy, %MAINWEB%.<nop>SomeGoodGirl, %MAINWEB%.<nop>TWikiAdminGroup==

	* 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.

---+++ Deny Renaming by Web

You can define restrictions of who is allowed to rename a %WIKITOOLNAME% web.

	* Define one or both of these variable in the %WEBPREFSTOPIC% topic:
		* ==Set <nop>DENYWEBRENAME = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWWEBRENAME = &lt; list of Users and Groups &gt;==

The same rules apply as for topics, with these additions:
	* DENYTOPICRENAME (in topic) overrides DENYWEBRENAME (in <nop>%WEBPREFSTOPIC%)
	* ALLOWTOPICRENAME (in topic) overrides ALLOWWEBRENAME (in <nop>%WEBPREFSTOPIC%)

---++ Restricting Read Access

You can define who is allowed to see a web.

---+++ Deny Viewing by Topic

%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.

---+++ Deny Viewing by Web

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:

	* *obfuscating webs:* Insecure but handy method to hide new webs until content is ready for deployment.
	* *authenticating all webs and restricting selected webs:* Topic access in all webs is authenticated, and selected webs have restricted access.
	* *authenticating and restricting selected webs only:* Provide unrestricted viewing access to open webs, with authentication and restriction only on selected webs.

---++++ Obfuscate Webs

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%:
	* ==Set <nop>NOSEARCHALL = on==

This setup can be useful to hide a new web until content its ready for deployment.

%X% *Obfuscating webs is insecure*, as anyone who knows the URL can access the web.

---++++ Authenticate all Webs and Restrict Selected Webs

Use the following setup to authenticate users for topic viewing in all webs and to restrict access to selected webs:

	1. *Restrict* view access to selected Users and Groups. Set one or both of these variables in its %WEBPREFSTOPIC% topic:
		* ==Set <nop>DENYWEBVIEW = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWWEBVIEW = &lt; list of Users and Groups &gt;==
		* __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.
	1. *Hide* the web from an "all webs" search. Enable this restriction with the ==NOSEARCHALL== variable in its %WEBPREFSTOPIC% topic:
		* ==Set <nop>NOSEARCHALL = on==
	1. *Add* ==view== to the list of authenticated scripts in the =.htaccess= file.

%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.

---++++ Authenticate and Restricting Selected Webs Only

Use the following setup to provide unrestricted viewing access to open webs, with authentication only on selected webs:

	1. *Restrict* view access to selected Users and Groups. Set one or both of these variables in its %WEBPREFSTOPIC% topic:
		* ==Set <nop>DENYWEBVIEW = &lt; list of Users and Groups &gt;==
		* ==Set <nop>ALLOWWEBVIEW = &lt; list of Users and Groups &gt;==
		* __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.
	1. *Hide* the web from an "all webs" search. Enable this restriction with the ==NOSEARCHALL== variable in its %WEBPREFSTOPIC% topic:
		* ==Set <nop>NOSEARCHALL = on==
	1. *Enable* the ==$doRememberRemoteUser== flag in ==lib/TWiki.cfg== as described in TWikiUserAuthentication. %WIKITOOLNAME% will now remember the IP address of an authenticated user. 
	1. *Copy* the ==view== script to ==viewauth== (or better, create a symbolic link) 
	1. *Add* ==viewauth== to the list of authenticated scripts in the =.htaccess= file. The ==view== script should not be listed in the =.htaccess= file.

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.

%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.


---++ Hiding Control Settings

%T% To hide access control settings from normal browser viewing, place them in comment markers.

<style="background-color:#f5f5f5">
=&lt;!--= <br />
=&nbsp;  * Set <nop>DENYTOPICCHANGE = Main.<nop>SomeGroup= <br />
=--&gt;=
</style>

#SuperAdminGroup
---++ The <nop>SuperAdminGroup

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*:
	* Set the ==$superAdminGroup== variable in ==lib/TWiki.cfg== to the name of a group of Users who are always allowed to edit/view topics.
<blockquote style="background-color:#f5f5f5">
<verbatim>
$superAdminGroup = "TWikiAdminGroup";
</verbatim>
</blockquote>
	* The default setting is not to have superusers.

-- Main.PeterThoeny - 04 May 2002<br />
-- Main.MikeMannix - 12 May 2002 

%STOPINCLUDE%
@


1.27
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="PeterThoeny" date="1041128291" format="1.0" version="1.27"}%
d27 6
@


1.26
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="PeterThoeny" date="1022686560" format="1.0" version="1.26"}%
d34 1
a34 1
A user is created with the TWikiRegistration form. The process generates a topic in the %MAINWEB% web in the new user's WikiName. The default visitor name is %MAINWEB%.TWikiGuest.
d36 8
a43 1
	* 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.
@


1.25
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="PeterThoeny" date="1022658495" format="1.0" version="1.25"}%
d147 1
d161 1
d175 7
a181 6
	* %T% To hide access control settings from normal browser viewing, place them in comment markers. 
<blockquote style="background-color:#f5f5f5">
	&lt;!--<br />
	* Set <nop>DENYTOPICCHANGE = Main.<nop>SomeGroup<br />
	--&gt;
</blockquote>
@


1.24
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="1021203240" format="1.0" version="1.24"}%
d115 1
a115 1
---++ Restricting Web Access
d117 1
a117 1
You can prevent selected Users and Groups from accessing certain webs, by hiding them using restricting read access, or by requiring login. There are two basic methods, one simple, using standard preferences variables to hide a web, but offering low security, and a secure log-in approach that is currently a workaround, involving some minor script and filesystem modification.
d119 1
a119 1
---+++ Create Hidden Webs
d121 1
a121 3
You can prevent selected Users and Groups from viewing certain %WIKITOOLNAME% webs by setting one or both of these variables in each web's %WEBPREFSTOPIC% topic:
	* ==Set <nop>DENYWEBVIEW = &lt; list of Users and Groups &gt;==
	* ==Set <nop>ALLOWWEBVIEW = &lt; list of Users and Groups &gt;==
d123 11
a133 1
%T% If keeping a hidden web out of general use is a consideration, you can prevent the ==all webs== search option from accessing hidden webs, by enabling the ==NOSEARCHALL== variable in WebPreferences:
a134 2
		* It is not recommended to restrict view access to individual topics since all content is searchable _within_ a web.
		* %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.
d136 1
a136 1
%X% *Hiding 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. _(See the next section for a more secure approach.)_
d138 16
a153 1
---+++ Create Authenticated Access By Web
d156 6
a161 1
	1. *Omit* the ==view== script from the =.htaccess= file.
d164 5
a168 1
	1. *Add* ==viewauth== to the list of authenticated scripts in the .htaccess file.
a169 4
	* 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.
	* 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:
		* ==Set <nop>NOSEARCHALL = on==
	* It is not recommended to restrict view access to individual topics since all content is searchable within a web - a search will turn up the "hidden" topic.
@


1.23
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="PeterThoeny" date="1020495474" format="1.0" version="1.23"}%
d7 1
a7 1
_Restricting read and write access to topics and webs, by users and groups_
d9 1
a9 1
TWikiAccessControl allows you restrict access to single topics and entire webs, by individual user and by user groups, in three main areas: view; edit &amp; attach; and rename/move/delete. These controls, combined with TWikiUserAuthentication, let you easily create and manage an extremely flexible, fine-grained privilege system.
d13 1
a13 1
Open, freeform editing is the essence of the WikiCulture - it's what makes TWiki different and often more effective than other collaboration tools. So, it is strongly recommended that decisions to restrict read or write access to a web or a topic are made with care. Experience shows that _unrestricted write access_ works very well because:
d15 1
a15 1
	* Peer influence is enough to ensure that only relevant content is posted.
d17 1
a17 1
	* Peer editing - the ability to rearrange anything on a page - keeps topics focussed.
d19 1
a19 1
	* All content is preserved under revision control.
d23 1
a23 1
As a collaboration guideline:
d25 2
a26 2
	* Create broad groups (more and varied input), and...
	* Avoid creating view-only users (if you can read it, you can contribute to it).
d30 1
a30 1
Access control is based on users and groups. Users are defined by their WikiNames, an then organized in unlimited combinations under different user groups.  
d34 1
a34 1
A user is created by with the TWikiRegistration form. The process generates a topic in the %MAINWEB% web in the new user's WikiName. The default visitor name is %MAINWEB%.TWikiGuest.
d36 1
a36 1
	* Users can be authenticated using Basic Authentication or SSL. TWikiUserAuthentication is required in order to track user identities.
d41 2
a42 2
Groups are defined by group topics in the ==%MAINWEB%== web, like the %MAINWEB%.TWikiAdminGroup. To create a new group:
	1. Start in %MAINWEB%.TWikiGroups and *create* a new topic with a name that ends in *Group*. Example:
d44 6
a49 8
	1. *Define* two variables in the group topic:
		* ==Set <nop>GROUP = &lt; list of users and/or groups &gt;==
		* ==Set <nop>ALLOWTOPICCHANGE = &lt; list of users and/or groups &gt;==

	* A variables is defined as a bullet of format =Set NAME = value=. A bullet line starts with a multiple of three spaces, an asterisk, and a space.
	* The GROUP variable is a comma-separated list of users and/or other groups. Example:
		* ==Set GROUP = %MAINWEB%.<nop>SomeUser, %MAINWEB%.<nop>OtherUser, %MAINWEB%.<nop>SomeOtherGroup==
	* 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 and from gaining unauthorized membership to the group.) For example, for the <nop>TWikiAdminGroup topic write:
d60 2
a61 2
		* ==Set <nop>DENYTOPICCHANGE = &lt; list of users and groups &gt;==
		* ==Set <nop>ALLOWTOPICCHANGE = &lt; list of users and groups &gt;==
d63 1
a63 1
	* 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:
d66 1
a66 1
	* 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:
d76 2
a77 2
		* ==Set <nop>DENYWEBCHANGE = &lt; list of users and groups &gt;==
		* ==Set <nop>ALLOWWEBCHANGE = &lt; list of users and groups &gt;==
d92 2
a93 2
		* ==Set <nop>DENYTOPICRENAME = &lt; list of users and groups &gt;==
		* ==Set <nop>ALLOWTOPICRENAME = &lt; list of users and groups &gt;==
d95 1
a95 1
	* DENYTOPICCRENAME defines users or groups that *are not* allowed to rename the topic. It is a comma delimited list of users and groups. Example:
d98 1
a98 1
	* ALLOWTOPICRENAME defines users or groups that *are* allowed to rename the topic. It is a comma delimited list of users and groups. Example:
d108 2
a109 2
		* ==Set <nop>DENYWEBRENAME = &lt; list of users and groups &gt;==
		* ==Set <nop>ALLOWWEBRENAME = &lt; list of users and groups &gt;==
d117 1
a117 1
You can prevent selected users and groups from accessing certain webs, by hiding them using restricting read access, or by requiring login. There are two basic methods, one simple, using standard preferences variables to hide a web, but offering low security, and a secure log-in approach that is currently a workaround, involving some minor script and filesystem modification.
d121 3
a123 3
You can prevent selected users and groups from viewing certain %WIKITOOLNAME% webs by setting one or both of these variables in each web's %WEBPREFSTOPIC% topic:
	* ==Set <nop>DENYWEBVIEW = &lt; list of users and groups &gt;==
	* ==Set <nop>ALLOWWEBVIEW = &lt; list of users and groups &gt;==
d128 1
a128 1
		* %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.
d143 1
a143 1
	* It is not recommended to restrict view access to individual topics since all content is searchable _within_ a web.
d150 1
a150 1
	Set <nop>DENYTOPICCHANGE = Main.<nop>SomeGroup<br />
d158 1
a158 1
	* Set the =$superAdminGroup= variable in =lib/TWiki.cfg= to the name of a group of users who are always allowed to edit/view topics.
d166 4
a169 2
-- Main.MikeMannix - 01 Apr 2002 <br />
-- Main.PeterThoeny - 04 May 2002
@


1.22
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="1017705859" format="1.0" version="1.22"}%
d20 1
a20 1
		* Edits can be undone by the %MAINWEB%.TWikiAdminGroup (the default administrators group; see #ManagingGroups).
d41 12
a52 12
Groups are defined by group topics in the ==%MAINWEB%== web, like the %MAINWEB%.TWikiAdminGroup. To start a new group:
	1. *Create* a new topic with A name that ends in *Group*, =<nop>SomeGroup=
	1. *Define* two variables:
		* Set <nop>GROUP = &lt; list of users and groups &gt;
		* Set <nop>ALLOWTOPICCHANGE = &lt; list of users and groups &gt;

	* GROUP is a comma-separated list of users and of other groups:<br />
	  ==&nbsp; &nbsp; Set <nop>GROUP = %MAINWEB%.<nop>SomeUser, %MAINWEB%.<nop>OtherUser, %MAINWEB%.<nop>SomeOtherGroup==

	* 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,<br /> 
	  ==&nbsp; &nbsp; Set <nop>ALLOWTOPICCHANGE = %MAINWEB%.<nop>TWikiAdminGroup== <br /> 
	  for the <nop>TWikiAdminGroup topic. (This prevents users not in the group from editing the topic and from gaining unauthorized membership to the group.)
d62 2
a63 2
		* Set <nop>DENYTOPICCHANGE = &lt; list of users and groups &gt;
		* Set <nop>ALLOWTOPICCHANGE = &lt; list of users and groups &gt;
d65 2
a66 1
	* 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> =&nbsp; &nbsp; * Set <nop>DENYTOPICCHANGE = %MAINWEB%.<nop>SomeBadBoy, %MAINWEB%.<nop>SomeBadGirl, %MAINWEB%.<nop>SomeHackerGroup=
d68 2
a69 1
	* 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> =&nbsp; &nbsp; * Set <nop>ALLOWTOPICCHANGE = %MAINWEB%.<nop>SomeGoodGuy, %MAINWEB%.<nop>SomeGoodGirl, %MAINWEB%.<nop>TWikiAdminGroup=
d78 2
a79 2
		* Set <nop>DENYWEBCHANGE = &lt; list of users and groups &gt;
		* Set <nop>ALLOWWEBCHANGE = &lt; list of users and groups &gt;
d94 2
a95 2
		* Set <nop>DENYTOPICRENAME = &lt; list of users and groups &gt;
		* Set <nop>ALLOWTOPICRENAME = &lt; list of users and groups &gt;
d97 2
a98 1
	* 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> =&nbsp; &nbsp; * Set <nop>DENYTOPICRENAME = %MAINWEB%.<nop>SomeBadBoy, %MAINWEB%.<nop>SomeBadGirl, %MAINWEB%.<nop>SomeHackerGroup=
d100 2
a101 1
	* ALLOWTOPICRENAME defines users or groups that *are* allowed to rename the topic. It is a comma delimited list of users and groups. Example: <br> =&nbsp; &nbsp; * Set <nop>ALLOWTOPICRENAME = %MAINWEB%.<nop>SomeGoodGuy, %MAINWEB%.<nop>SomeGoodGirl, %MAINWEB%.<nop>TWikiAdminGroup=
d110 2
a111 2
		* Set <nop>DENYWEBRENAME = &lt; list of users and groups &gt;
		* Set <nop>ALLOWWEBRENAME = &lt; list of users and groups &gt;
d124 2
a125 2
	* Set <nop>DENYWEBVIEW = &lt; list of users and groups &gt;
	* Set <nop>ALLOWWEBVIEW = &lt; list of users and groups &gt;
d128 1
a128 1
	* Set <nop>NOSEARCHALL = on
d136 1
a136 40
<font size="2">%X% __THIS SECTION CONTAINS WORKAROUNDS.__ _Perhaps unconventional for official documentation, but practical, the following method for extending TWiki functionality involves modifying core TWiki, making it essentially not a feature but a hack. Still, it is officially TWiki developer-approved and documented, and will no doubt be included in some form in an upcoming edition of TWiki._ </font>

*To selectively restrict web access* with the security of Basic Authentication, there is a reliable workaround that involves some straightforward code modification:
	1. Set aside the ==view== script (rename) and create a ==view== subdirectory in its place.
	1. In the ==view== subdirectory, create a separate copy of a modified viewing script for each web, and create ==.htaccess== settings for the restricted webs.
		* %T% You can use symbolic links to a single copy of the viewing script to make any script updates that much easier.

<blockquote style="background-color:#f5f5f5">
*Example of viewing script* ==redirect==
<verbatim>
#!/usr/bin/perl -w
#

chdir '..';

# Adjust SCRIPT and PATH_INFO variables to account for the changed directory
my $web = $ENV{SCRIPT_NAME};
$web	 =~ s#^.*/view(/[^/]*).*$#$1#; # isolate the path element after "view"
$ENV{PATH_TRANSLATED} =~ s#(/[^/]*)$#$web$1#;
$ENV{PATH_INFO}		 =~ s#(/[^/]*)$#$web$1#;
$ENV{SCRIPT_NAME}	  =~ s#/view$web#/view#;
$ENV{SCRIPT_FILENAME} =~ s#/view$web#/view#;

# open (LOG, '>>/tmp/redirect.log');
# print LOG join ("\n", scalar localtime (time ()), %ENV);
# close LOG;
exec ('/usr/bin/perl', '-wT', 'view.orig') or

print <<EOF;
Content-type: text/plain

Error executing /cgi-bin/view.orig: $?
Click the BACK button in your browser and contact webmaster\@@bcs-oops.org.

EOF
</verbatim>
</blockquote>
	* __(mod by Main.ImmoHuneke - 16 Mar 2002)__

*A SECOND OPTION:* A less reliable workaround that doesn't involve code changes, but does require renaming a script, can provide the same generally unrestricted viewing access, with authentication only on selected webs:
d141 5
a145 4
		* 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.
		* 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:
			* Set <nop>NOSEARCHALL = on
		* It is not recommended to restrict view access to individual topics since all content is searchable _within_ a web.
d168 2
a169 1
-- Main.MikeMannix - 01 Apr 2002
@


1.21
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="1016622944" format="1.0" version="1.21"}%
d60 1
a60 1
Denying editing of a topic also restricts attaching files to it; both privileges are assigned together.
d120 5
a124 4
		* Set <nop>DENYWEBVIEW = &lt; list of users and groups &gt;
		* Set <nop>ALLOWWEBVIEW = &lt; list of users and groups &gt;
	* If keeping a hidden web out of general use is a consideration, you should also prevent the "all webs" search option from accessing each hidden web, by enabling the ==NOSEARCHALL== variable in WebPreferences:
		* Set <nop>NOSEARCHALL = on
d126 3
a128 2
	* %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 with, for example, view-only access for public webs.) TWikiInstallationGuide has more on Basic Authentication, using the ==.htaccess== file.
	* %X% *Hiding 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.
d132 3
a134 1
To selectively restrict web access with the security of Basic Authentication, there is a reliable workaround that involves some straightforward code modification:
d139 1
a139 1
<blockquote>
d169 1
a169 1
	* __(Mod by Main.ImmoHuneke - 16 Mar 2002)__
d171 1
a171 1
*A SECOND OPTION:* A less reliable workaround that also requires code changes is available to provide the same unrestricted viewing access, with authentication required only on selected webs:
d173 3
a175 1
	1. *Enable* the ==$doRememberRemoteUser== flag in ==lib/TWiki.cfg== as described in TWikiUserAuthentication. %WIKITOOLNAME% will now remember the IP address of an authenticated user.	 1. *Copy* the ==view== script to ==viewauth== (or better, create a symbolic link)	 1. *Add* ==viewauth== to the list of authenticated scripts in the .htaccess file.
d193 2
a194 2
By mistyping a user or group name in the ALLOWTOPICCHANGE setting, it's possible to lock a topic so that it no-one can edit it from a browser. To avoid this:
	* Set the =$superAdminGroup= variable in =lib/TWiki.cfg= to the name of a group of users that are always allowed to edit/view topics.
d202 1
a202 1
-- Main.MikeMannix - 20 Mar 2002
@


1.20
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="1007283720" format="1.0" version="1.20"}%
a8 2
---++ Overview

d30 1
a30 1
Access control is based on users and groups. Users are defined by their WikiNames, an then organized into unlimited combinations under different user groups.  
d113 3
a115 1
---++ Restricting Read Access
d117 1
a117 1
You can define restrictions of who is allowed to view a %WIKITOOLNAME% web.
d119 1
a119 1
	* Define one or both of these variable in the %WEBPREFSTOPIC% topic:
d122 18
d141 1
a141 1
---+++ Known Issues
d143 12
a154 2
	* The view restriction is not suitable for very sensitive content since there is a way to circumvent the read access restriction.
	* Read access restriction only works if the view script is authenticated, that means that users need to log on also just to read topics. TWikiInstallationGuide has more on Basic Authentication based on the ==.htaccess== file.
d156 10
a165 1
---++++ Selective Unrestricted Web Access
d167 7
a173 9
	* 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:
		1. *Omit* the ==view== script from the =.htaccess= file.
		1. *Enable* the ==$doRememberRemoteUser== flag in ==lib/TWiki.cfg== as described in TWikiUserAuthentication. %WIKITOOLNAME% will now remember the IP address of an authenticated user.
		1. *Copy* the ==view== script to ==viewauth== (or better, create a symbolic link)
		1. *Add* ==viewauth== to the list of authenticated scripts in the .htaccess file.
			* 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.
			* 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:
				* Set <nop>NOSEARCHALL = on
			* It is not recommended to restrict view access to individual topics since all content is searchable _within_ a web.
d196 1
a196 1
-- Main.MikeMannix - 02 Dec 2001	
@


1.19
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="1000616943" format="1.0" version="1.19"}%
d44 1
a44 1
	1. *Create* a new topic with A name that ends in *Group*, =SomeGroup=
d49 2
a50 2
		* GROUP is a comma-separated list of users and of other groups:<br>
	  ==&nbsp; &nbsp; * Set <nop>GROUP = %MAINWEB%.<nop>SomeUser, %MAINWEB%.<nop>OtherUser, %MAINWEB%.<nop>SomeOtherGroup==
d52 3
a54 1
		* 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,<br> =&nbsp; &nbsp; * Set <nop>ALLOWTOPICCHANGE = %MAINWEB%.<nop>TWikiAdminGroup= <br> for the <nop>TWikiAdminGroup topic. (This prevents users not in the group from editing the topic and from gaining unauthorized membership to the group.)
d140 9
d161 1
a161 2
-- PeterThoeny - 16 Mar 2001 <br />
-- AndreaSterbini - 11 Apr 2001 <br />
@


1.18
log
@none
@
text
@d1 1
a1 3
%META:TOPICINFO{author="PeterThoeny" date="1000455102" format="1.0" version="1.18"}%
%INCLUDE{"UtilTempDocNote"}%

d143 1
a143 1
<blockquote style="background-color:#f0f0f0">
d150 2
a151 4
-- PeterThoeny - 16 Mar 2001 <br>
-- AndreaSterbini - 11 Apr 2001 <br> 
%STOPINCLUDE%
__Related topics:__ %WIKIPREFSTOPIC%, %WEBPREFSTOPIC% (in every web), %MAINWEB%.TWikiAdminGroup, %MAINWEB%.TWikiGroups
@


1.17
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="1000279941" format="1.0" version="1.17"}%
d13 1
a13 1
TWikiAccessControl allows you restrict access to single topics and entire webs, by individual user and by user groups, in three main areas: view; edit &amp; attach; and rename/move/delete. These controls, combined with [[TWikiDocumentation#TWiki_User_Authentication][TWikiUserAuthentication]], let you easily create and manage an extremely flexible, fine-grained privilege system.
d17 1
a17 1
Open, freeform editing is the essence of the %TWIKIWEB%.WikiCulture - it's what makes TWiki different and often more effective than other collaboration tools. So, it is strongly recommended that decisions to restrict read or write access to a web or a topic are made with care. Experience shows that _unrestricted write access_ works very well because:
d24 1
a24 1
		* Edits can be undone by the %MAINWEB%.TWikiAdminGroup (the default administrators group; see [[#ManagingGroups][Managing Groups]]).
d38 1
a38 1
A user is created by with the <a target="TWikiRegistration" onClick="return launchWindow('TWiki','TWikiRegistration')" href="%SCRIPTULRPATH%/view%SCRIPTSUFFIX%/TWiki/TWikiRegistration">TWikiRegistration</a> form. The process generates a topic in the %MAINWEB% web in the new user's WikiName. The default visitor name is %MAINWEB%.TWikiGuest.
d40 1
a40 1
	* Users can be authenticated using Basic Authentication or SSL. [[TWikiDocumentation#TWikiAuthentication][Authentication]] is required in order to track user identities.
d126 1
a126 1
	* Read access restriction only works if the view script is authenticated, that means that users need to log on also just to read topics. [[TWikiDocumentation#TWikiInstallationGuide][TWiki Installation Guide]] has more on Basic Authentication based on the ==.htaccess== file.
d132 1
a132 1
		1. *Enable* the ==$doRememberRemoteUser== flag in ==lib/wikicfg.pm== as described in [[TWikiDocumentation#TWikiUserAuthentication][User Authentication]]. %WIKITOOLNAME% will now remember the IP address of an authenticated user.
@


1.16
log
@none
@
text
@d1 3
a3 1
%META:TOPICINFO{author="MikeMannix" date="999857173" format="1.0" version="1.16"}%
@


1.15
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="999848020" format="1.0" version="1.15"}%
d5 1
a5 1
---## TWiki Access Control
d9 1
a9 1
---+++ Overview
d13 1
a13 1
---+++ An Important Control Consideration
d30 1
a30 1
---+++ Users and Groups
d34 1
a34 1
---++++ Managing Users
d41 1
a41 1
---++++ Managing Groups
d54 1
a54 1
---+++ Restricting Write Access
d58 1
a58 1
---++++ Deny Editing by Topic
d71 1
a71 1
---++++ Deny Editing by Web
d83 1
a83 1
---+++ Restricting Rename Access
d87 1
a87 1
---++++ Deny Renaming by Topic
d101 1
a101 1
---++++ Deny Renaming by Web
d113 1
a113 1
---+++ Restricting Read Access
d121 1
a121 1
---++++ Known Issues
d126 1
a126 1
---+++++ Selective Unrestricted Web Access
d139 1
a139 1
---+++ The <nop>SuperAdminGroup
@


1.14
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="999674195" format="1.0" version="1.14"}%
d11 5
a15 1
%WIKITOOLNAME% allows you to define restrictions of who is allowed to view a %WIKITOOLNAME% web, make changes to topics or attach files.
a16 1
*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 %TWIKIWEB%.WikiCulture. Experience shows that unrestricted write access works very well because:
d18 3
a20 1
	* Peer editing - edit anything on a page - keeps topics focussed.
d23 6
a28 1
		* Editing and refactoring (condensing a long topic) is encouraged (there's a safety net).
d32 1
a32 1
Access control is based on users and groups.
d36 3
a38 2
A user is created by with the <nop>TWikiRegistration form. The process generates a topic in the %MAINWEB% web in the new user's WikiName. The default visitor name is %MAINWEB%.TWikiGuest.
	* Users can be authenticated using Basic Authentication or SSL. [[TWikiDocumentation#TWikiAuthentication][TWiki Authentication]] has more.
d43 3
a45 4
Groups are defined by group topics in the %MAINWEB% web, like the %MAINWEB%.TWikiAdminGroup.
	* A group topic name must end in *_Group*
	* The group topic should define these two variables:
<blockquote style="background-color:#f0f0f0">
d48 5
a52 3
</blockquote>
	* GROUP defines the members of the group; it is a comma delimited list of users and other groups. Example: <br> ==&nbsp; &nbsp; * Set <nop>GROUP = %MAINWEB%.<nop>SomeUser, %MAINWEB%.<nop>OtherUser, %MAINWEB%.<nop>SomeOtherGroup==
	* 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> =&nbsp; &nbsp; * Set <nop>ALLOWTOPICCHANGE = %MAINWEB%.<nop>TWikiAdminGroup= <br> for the <nop>TWikiAdminGroup topic. (This is to prevent users not in the group from editing the topic and gaining unauthorized membership to the group.)
d56 2
d60 4
a63 1
You can define restrictions of who is allowed to make changes to a topic or attach files to it.
d65 1
a65 3
Define one or both of these variables in a topic, preferably at the end of the topic:
	* Set <nop>DENYTOPICCHANGE = &lt; list of users and groups &gt;
	* Set <nop>ALLOWTOPICCHANGE = &lt; list of users and groups &gt;
d67 1
a67 1
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> =&nbsp; &nbsp; * Set <nop>DENYTOPICCHANGE = %MAINWEB%.<nop>SomeBadBoy, %MAINWEB%.<nop>SomeBadGirl, %MAINWEB%.<nop>SomeHackerGroup=
d69 1
a69 3
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> =&nbsp; &nbsp; * Set <nop>ALLOWTOPICCHANGE = %MAINWEB%.<nop>SomeGoodGuy, %MAINWEB%.<nop>SomeGoodGirl, %MAINWEB%.<nop>TWikiAdminGroup=

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.
d73 1
a73 1
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.
d75 3
a77 3
Define one or both of these variable in the %WEBPREFSTOPIC% topic:
	* Set <nop>DENYWEBCHANGE = &lt; list of users and groups &gt;
	* Set <nop>ALLOWWEBCHANGE = &lt; list of users and groups &gt;
d79 1
a79 1
The same rules apply like the one for Access Control for Individual Topics; with these additions:
d85 1
a85 1

d89 1
a89 1
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.
d91 3
a93 3
Define one or both of these variables in a topic, preferably at the end of the topic:
	* Set <nop>DENYTOPICRENAME = &lt; list of users and groups &gt;
	* Set <nop>ALLOWTOPICRENAME = &lt; list of users and groups &gt;
d95 1
a95 1
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> =&nbsp; &nbsp; * Set <nop>DENYTOPICRENAME = %MAINWEB%.<nop>SomeBadBoy, %MAINWEB%.<nop>SomeBadGirl, %MAINWEB%.<nop>SomeHackerGroup=
d97 1
a97 1
ALLOWTOPICRENAME defines users or groups that *are* allowed to rename the topic. It is a comma delimited list of users and groups. Example: <br> =&nbsp; &nbsp; * Set <nop>ALLOWTOPICRENAME = %MAINWEB%.<nop>SomeGoodGuy, %MAINWEB%.<nop>SomeGoodGirl, %MAINWEB%.<nop>TWikiAdminGroup=
d99 1
a99 1
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.
d103 1
a103 1
You can define restrictions of who is allowed to do renames for a %WIKITOOLNAME% web.
d105 3
a107 3
Define one or both of these variable in the %WEBPREFSTOPIC% topic:
	* Set <nop>DENYWEBRENAME = &lt; list of users and groups &gt;
	* Set <nop>ALLOWWEBRENAME = &lt; list of users and groups &gt;
d109 1
a109 1
The same rules apply like the one for Access Control for Individual Topics; with these additions:
d117 3
a119 3
Define one or both of these variable in the %WEBPREFSTOPIC% topic:
	* Set <nop>DENYWEBVIEW = &lt; list of users and groups &gt;
	* Set <nop>ALLOWWEBVIEW = &lt; list of users and groups &gt;
d129 8
a136 8
		* Leave the ==view== script non-authenticated in the =.htaccess= file.
		* Enable the ==$doRememberRemoteUser== flag in ==lib/wikicfg.pm== as described in [[TWikiDocumentation#TWikiUserAuthentication][User Authentication]]. %WIKITOOLNAME% will now remember the IP address of an authenticated user.
		* Copy the ==view== script to ==viewauth== (or better, create a symbolic link)
		* Add ==viewauth== to the list of authenticated scripts in the .htaccess file.
		* 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.
	* 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:
		* Set <nop>NOSEARCHALL = on
	* It is not recommended to restrict view access to individual topics since all content is searchable _within_ a web.
d141 3
a143 2
The above schema can lock completely a topic in case of a typing error of the ALLOWTOPICCHANGE setting (see [[TWiki:Codev/UnchangeableTopicBug][UnchangeableTopicBug]] for more detail). To avoid this:
	* Set the ==$superAdminGroup== variable in ==lib/TWiki.cfg== to the name of a group of users that are always allowed to edit/view topics.
d147 1
@


1.13
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="999580216" format="1.0" version="1.13"}%
d125 1
@


1.12
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="999260330" format="1.0" version="1.12"}%
d7 4
d14 5
a18 4
	* There is enough peer pressure to post only conform content.
	* Content does not get lost because topics are under revision control.
	* A topic revision can be undone by a member of the %MAINWEB%.TWikiAdminGroup in case needed.

d24 7
a30 2
__Users__ are defined by the user topics in the %MAINWEB% web, i.e. %MAINWEB%.TWikiGuest
	* Users can be authenticated using basic authentication or SSL. <A href="TWikiDocumentation#installation">Installation Notes</A> has more.
d32 2
a33 2
__Groups__ are defined by group topics in the %MAINWEB% web, i.e. %MAINWEB%.TWikiAdminGroup
	* A group topic name must end in *...Group*
d35 1
d38 2
a39 1
	* GROUP defines the members of the group; it is a comma delimited list of users and other groups. Example: <br> =&nbsp; &nbsp; * Set <nop>GROUP = %MAINWEB%.<nop>SomeUser, %MAINWEB%.<nop>OtherUser, %MAINWEB%.<nop>SomeOtherGroup=
d42 1
d44 1
a44 1
---+++ Write Access Restriction by Topic
d58 1
a58 1
---+++ Write Access Restriction by Web
d70 5
a74 1
---+++ Rename Access Restriction by Topic
d88 1
a88 1
---+++ Rename Access Restriction by Web
d100 1
a100 1
---+++ Read Access Restriction by Web
d108 1
a108 1
---+++ Read Restriction Known Issues
d111 4
a114 1
	* Read access restriction only works if the view script is authenticated, that means that users need to log on also just to read topics. <a href="TWikiDocumentation#installation">TWiki Installation</a> has more on basic authentication based on the =.htaccess= file.
d116 4
a119 4
		* Leave the =view= script non authenticated in the =.htaccess= file.
		* Enable the =$doRememberRemoteUser= flag in =wikicfg.pm= as described in <a href="TWikiDocumentation#authentication">TWiki Authentication</a>. %WIKITOOLNAME% will now remember the IP address of an authenticated user.
		* Copy the =view= script to =viewauth= (or better, create a symbolic link)
		* Add =viewauth= to the list of authenticated scripts in the .htaccess file.
d121 1
a121 1
	* 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:
d123 1
a123 1
	* It is not recommended to restrict view access to individual topics since all content is searchable __within__ a web.
d127 3
a129 3
The above schema can lock completely a topic in case of a typing error of the ALLOWTOPICCHANGE setting (see [[http://www.twiki.org/cgi-bin/view/Codev/UnchangeableTopicBug][UnchangeableTopicBug]]). To avoid this:
	* set the =$superAdminGroup= variable in =TWiki.cfg= to the name of a group of users that are always allowed to edit/view topics. E.g.:
<pre>
d131 2
a132 2
</pre>
	* the default setting is not to have superusers
@


1.11
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="999209840" format="1.0" version="1.11"}%
d91 1
a91 1
---++++ Read Access Restriction Notes
d95 1
a95 1
	* 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:
d100 1
a100 1
		* 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.
a103 2
	* The view restriction is not suitable for very sensitive content since there is a way to circumvent the read access restriction.

d105 1
a105 1
---+++ The SuperAdminGroup
@


1.10
log
@none
@
text
@d1 4
a4 1
%META:TOPICINFO{author="MikeMannix" date="999078876" format="1.0" version="1.10"}%
d31 1
a31 1
---+++ Write Access Restriction for Individual Topics
d45 1
a45 1
---+++ Write Access Restriction for a Whole %WIKITOOLNAME% Web
d57 1
a57 1
---+++ Rename Access Restriction for Individual Topics
d71 1
a71 1
---+++ Rename Access Restriction for a Whole %WIKITOOLNAME% Web
d83 1
a83 1
---+++ Read Access Restriction for a Whole %WIKITOOLNAME% Web
d91 2
a92 1
_Notes for read access restriction:_
a105 1
-- PeterThoeny - 16 Mar 2001 <br>
d107 1
a107 1
__NOTE:__
d116 1
d118 2
a119 2

__Related topics:__ %WIKIPREFSTOPIC%, %WEBPREFSTOPIC% (in every web), %MAINWEB%.TWikiAdminGroup, %MAINWEB%.TWikiGroups
@


1.9
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="JohnTalintyre" date="997199070" format="1.0beta2" version="1.9"}%
d102 3
d106 6
a111 1
__Related topics:__ %WIKIPREFSTOPIC%, %WEBPREFSTOPIC% (in every web), %MAINWEB%.TWikiAdminGroup, %MAINWEB%.TWikiGroups
d113 3
a115 1
-- PeterThoeny - 16 Mar 2001 <br>
@


1.8
log
@none
@
text
@d1 1
d53 26
@


1.7
log
@none
@
text
@d68 1
a68 1
		* Enable authentication for the =viewauth= script in the =.htaccess= file.
@


1.6
log
@none
@
text
@d1 2
d11 1
a11 1
__Users and Groups__
d27 1
a27 1
__Write Access Restriction for Individual Topics__
d41 1
a41 1
__Write Access Restriction for a Whole %WIKITOOLNAME% Web__
d53 1
a53 1
__Read Access Restriction for a Whole %WIKITOOLNAME% Web__
d78 1
a78 1
-- Main.PeterThoeny - 20 Jan 2001 <br>
@


1.5
log
@none
@
text
@d60 1
@


1.4
log
@none
@
text
@d60 7
@


1.3
log
@none
@
text
@d1 1
a1 1
%WIKITOOLNAME% allows to define some restrictions of who is allowed to make changes and attach files to topics.
d3 1
a3 1
*IMPORTANT NOTE:* Think twice before restricting write access to a web or a topic, because an open system where everybody can contribute is the essence of the %TWIKIWEB%.WikiCulture. Experience shows that unrestricted write access works very well because:
d25 1
a25 1
__Access Control for Individual Topics__
d27 1
a27 1
You can define some restrictions of who is allowed to make changes and attach files to a topic.
d39 1
a39 1
__Access Control per %WIKITOOLNAME% Web__
d41 1
a41 1
You can define some restrictions of who is allowed to make changes and attach files to topics or create new topics in a %WIKITOOLNAME% web.
d51 15
d68 1
a68 1
-- Main.PeterThoeny - 28 Oct 2000 <br>
@


1.2
log
@none
@
text
@d43 1
a43 1
Define one or both of these variable in the WebPreferences topic:
d48 2
a49 2
	* DENYTOPICCHANGE (in topic) overrides DENYWEBCHANGE (in <nop>WebPreferences)
	* ALLOWTOPICCHANGE (in topic) overrides ALLOWWEBCHANGE (in <nop>WebPreferences)
d51 1
a51 1
__Related topics:__ TWikiPreferences, WebPreferences (in every web), %MAINWEB%.TWikiAdminGroup, %MAINWEB%.TWikiGroups
@


1.1
log
@none
@
text
@d3 5
a7 1
*IMPORTANT NOTE:* Is is recommended to use the access control feature only if absolutely necessary because it goes against the free WikiCulture, where everybody is invited to contribute to any topic.
d51 1
a51 1
__Related topics:__ TWikiPreferences, WebPreferences (in every web), %MAINWEB%.TWikiAdminGroup
@
