On this page:
TWiki Access ControlRestricting read and write access to topics and webs, by Users and groups | |||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | 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. | ||||||||||||||||||||||||
> > | 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. | ||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > | ![]() ![]() | ||||||||||||||||||||||||
An Important Control Consideration | |||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | 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: | ||||||||||||||||||||||||
> > | 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: | ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | |||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
| |||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < | |||||||||||||||||||||||||
As a collaboration guideline: | |||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > | Permissions settings of the webs on this TWiki site
| ||||||||||||||||||||||||
Authentication vs. Access ControlAuthentication: 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 GroupsAccess 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 UsersA user can create an account in TWikiRegistration. The following actions are performed: | |||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | |||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
| |||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < | 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 TWikiGuest. This is the non-authenticated user.
Managing Groups | |||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Groups are defined by group topics created in the Main web, like the TWikiAdminGroup. To create a new group:
| ||||||||||||||||||||||||
> > | Groups are defined by group topics located in the Main web, such as the TWikiAdminGroup. To create a new group, visit 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:
| ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Restricting Write Access | ||||||||||||||||||||||||
> > | The GROUP setting is a comma-separated list of users and/or other groups. Example: | ||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | You can define who is allowed to make changes to a web or a topic. | ||||||||||||||||||||||||
> > | 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 TWikiAdminGroup topic write: | ||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Deny Editing by Topic | ||||||||||||||||||||||||
> > | ![]() | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Denying editing of a topic also restricts file attachment; both privileges are assigned together.
| ||||||||||||||||||||||||
> > |
The Super Admin Group | ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
> > | 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:
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
> > | Restricting Access | ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
> > | 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. | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Deny Editing by Web | ||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Restricting web-level editing blocks creating new topics, changing topics or attaching files. | ||||||||||||||||||||||||
> > | Controlling access to a Web | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
> > | You can define restrictions of who is allowed to view a TWiki web. You can restrict access to certain webs to selected Users and Groups, by: | ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | The same rules apply as for restricting topics, with these additions:
| ||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Restricting Rename Access | ||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | You can define who is allowed to rename, move or delete a topic, or rename a web. | ||||||||||||||||||||||||
> > | Be careful with empty values for any of these. In older versions of TWiki, | ||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Deny Renaming by Topic | ||||||||||||||||||||||||
> > | Controlling access to a Topic | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | 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. | ||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
> > | 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. | ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
> > | Be careful with empty values for any of these. In older versions of TWiki,
| ||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > | 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
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
> > | Controlling access to Attachments | ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
> > | 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. | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Deny Renaming by Web | ||||||||||||||||||||||||
> > | 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, | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | You can define restrictions of who is allowed to rename a TWiki web. | ||||||||||||||||||||||||
> > | |||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > | ScriptAlias /twiki/bin/ /filesystem/path/to/twiki/bin/ Alias /twiki/pub/ /filesystem/path/to/twiki/pub/ | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
> > | RewriteEngine on RewriteRule ^/twiki/pub/TWiki/(.*)$ /twiki/pub/TWiki/$1 [L,PT] RewriteRule ^/twiki/pub/([^\/]+)/([^\/]+)/([^\/]+)$ /twiki/bin/viewfile/$1/$2?filename=$3 [L,PT] | ||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > | |||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | The same rules apply as for topics, with these additions: | ||||||||||||||||||||||||
> > | That way all the controls that apply to the topic also apply to attachments to the topic. Other types of webserver have similar support. | ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Restricting Read Access | ||||||||||||||||||||||||
> > | Note: Images embedded in topics will load much slower since each image will be delivered by the viewfile script. | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | You can define who is allowed to see a web. | ||||||||||||||||||||||||
> > | How TWiki evaluates ALLOW/DENY settings | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Deny Viewing by Topic | ||||||||||||||||||||||||
> > | 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. | ||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | ![]() 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. | ||||||||||||||||||||||||
> > | Access Control quick recipes | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Deny Viewing by Web | ||||||||||||||||||||||||
> > | Obfuscating Webs | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | You can define restrictions of who is allowed to view a TWiki web. You can restrict access to certain webs to selected Users and Groups, by: | ||||||||||||||||||||||||
> > | 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 WebPreferences: | ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
Obfuscate WebsThe idea is to keep a web hidden by not publishing its URL and by preventing theall webs search option from accessing obfuscated webs. Do so by enabling the NOSEARCHALL variable in WebPreferences: | ||||||||||||||||||||||||
| |||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | This setup can be useful to hide a new web until content its ready for deployment. | ||||||||||||||||||||||||
> > | This setup can be useful to hide a new web until content its ready for deployment, or to hide view access restricted webs. | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | ![]() | ||||||||||||||||||||||||
> > | ![]() | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Authenticate all Webs and Restrict Selected Webs | ||||||||||||||||||||||||
> > | Authenticate all Webs and Restrict Selected Webs | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Use the following setup to authenticate users for topic viewing in all webs and to restrict access to 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. | ||||||||||||||||||||||||
| |||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | ![]() view script is authenticated, which means that all Users have to login, even for read-only access. (An open guest account, like 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 Restrict Selected Webs Only | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | Authenticate and Restricting 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. | ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < | Use the following setup to provide unrestricted viewing access to open webs, with authentication only on selected webs: | ||||||||||||||||||||||||
| |||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | When a user accesses a web where you enabled view restriction, TWiki 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. | ||||||||||||||||||||||||
> > | Hide Control Settings | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < | ![]() | ||||||||||||||||||||||||
> > | ![]() | ||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||
< < |
Hiding Control Settings![]() | ||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
<style="background-color:#f5f5f5">
<!-- * Set DENYTOPICCHANGE = Main.SomeGroup -->
The SuperAdminGroupBy 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:
$superAdminGroup = "TWikiAdminGroup"; | ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||||
< < | -- TWiki:Main.PeterThoeny![]() -- TWiki:Main.MikeMannix ![]() | ||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||
> > | Related Topics: AdminDocumentationCategory, TWikiUserAuthentication, TWiki:TWiki.TWikiAccessControlSupplement![]() ![]() ![]() ![]() | ||||||||||||||||||||||||