We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> TWiki Web>TWikiAccessControl (25 Sep 2008, PeterThoeny)
Tags:
access_control2Add my vote for this tag create new tag
, view all tags
ALERT! NOTE: This is a DistributionDocument. Please help maintain high quality documentation: This is a wiki, please fix the documentation if you find errors or incomplete content. Put questions and suggestions concerning the documentation of this topic in the comments section below. Use the Support web for problems you are having using TWiki.

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.

TIP Tip: TWiki:TWiki.TWikiAccessControlSupplement on TWiki.org has additional documentation on access control.

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 administrator (per default a member of TWikiAdminGroup; 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

Web Sitemap VIEW CHANGE
Listed DENY ALLOW DENY ALLOW
Preferences Home Main on        
Preferences Home TWiki04x02 on       TWikiAdminGroup
Preferences Home Blog on       TWikiCommunityGroup
Preferences Home Codev on       TWikiCommunityGroup
Preferences Home Plugins on       TWikiCommunityGroup
Preferences Home Sandbox on        
Preferences Home Support on        
Preferences Home TWiki on       TWikiCommunityGroup
Preferences Home TWiki01 on       TWikiAdminGroup
Preferences Home TWiki02 on       TWikiAdminGroup
Preferences Home TWiki03 on       TWikiAdminGroup
Preferences Home TWiki04 on       TWikiAdminGroup, CrawfordCurrie
Preferences Home TWiki04x01 on       TWikiAdminGroup

See TWikiAccessControl for details

Please Note:

  • A blank in the the above table may mean either the corresponding control is absent or commented out or that it has been set to a null value. The two conditions have dramatically different and possibly opposed semantics.
  • TWikiGuest is the guest account - used by unauthenticated users.
  • The TWiki web must not deny view to TWikiGuest; otherwise, people will not be able to register.

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 Main web.
  • The user is added to the TWikiUsers topic.

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

Managing Groups

The following describes the standard TWiki support for groups. Your local TWiki may have an alternate group mapping manager installed. Check with your TWiki administrator if you are in doubt.

Groups are defined by group topics located in the Main web. 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:

  • Set GROUP = < list of Users and/or Groups >
  • Set ALLOWTOPICCHANGE = < list of Users and/or Groups >

The GROUP setting is a comma-separated list of users and/or other groups. Example:

  • Set GROUP = Main.SomeUser, Main.OtherUser, Main.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 KasabianGroup topic write:

  • Set ALLOWTOPICCHANGE = Main.KasabianGroup

ALERT! 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.

The Super Admin Group

A number of TWiki functions (for example, renaming webs) are only available to administrators. Administrators are simply users who belong to the SuperAdminGroup. This is a standard user group, the name of which is defined by {SuperAdminGroup} setting in configure. The default name of this group is the TWikiAdminGroup. The system administrator may have chosen a different name for this group if your local TWiki uses an alternate group mapping manager but for simplicity we will use the default name TWikiAdminGroup in the rest of this topic.

You can create new administrators simply by adding them to the TWikiAdminGroup topic. For example,

  • Set GROUP= Main.ElizabethWindsor, Main.TonyBlair
A member of the Super Admin Group has unrestricted access throughout the TWiki, so only trusted staff should be added to this group.

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 prevents renaming of topics within a web.

Note that there is an important distinction between CHANGE access and RENAME access. A user can CHANGE a topic, but thanks to version control their changes cannot be lost (the history of the topic before the change is recorded). However if a topic or web is renamed, that history may be lost. Typically a site will only give RENAME access to administrators and content owners.

Controlling access to a Web

You can define restrictions on who is allowed to view a TWiki 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 WebPreferences topic, preferable towards the end of the topic:
    • Set DENYWEBVIEW = < comma-delimited list of Users and Groups >
    • Set ALLOWWEBVIEW = < comma-delimited list of Users and Groups >
    • Set DENYWEBCHANGE = < comma-delimited list of Users and Groups >
    • Set ALLOWWEBCHANGE = < comma-delimited list of Users and Groups >
    • Set DENYWEBRENAME = < comma-delimited list of Users and Groups >
    • Set ALLOWWEBRENAME = < comma-delimited list of Users and Groups >

If your site allows hierarchical webs, then access to sub-webs is determined from the access controls of the parent web, plus the access controls in the sub-web. So, if the parent web has ALLOWWEBVIEW set, this will also apply to the subweb.

Also note that if your site allows hierarchical webs, you will need to ensure that the parent web's FINALPREFERENCES does not include the access control settings listed above. Otherwise you will not be able override the parent web's access control settings in sub-webs.

Creation and renaming of sub-webs is controlled by the WEBCHANGE setting on the parent web (or ROOTCHANGE for root webs). Renaming is additionally restricted by the setting of WEBRENAME in the web itself.

Note: For Web level access rights Setting any of these settings to an empty value has the same effect as not setting them at all. Please note that the documentation of TWiki 4.0 and earlier versions of TWiki 4.1 did not reflect the actual implementation, e.g. an empty ALLOWWEBVIEW does not prevent anyone from viewing the web, and an an empty DENYWEBVIEW does not allow all to view the web.

Controlling access to a Topic

  • You can define these settings in any topic, preferable towards the end of the topic:
    • Set DENYTOPICVIEW = < comma-delimited list of Users and Groups >
    • Set ALLOWTOPICVIEW = < comma-delimited list of Users and Groups >
    • Set DENYTOPICCHANGE = < comma-delimited list of Users and Groups >
    • Set ALLOWTOPICCHANGE = < comma-delimited list of Users and Groups >
    • Set DENYTOPICRENAME = < comma-delimited list of Users and Groups >
    • Set ALLOWTOPICRENAME = < comma-delimited list of Users and Groups >

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.

  • Set ALLOWTOPICVIEW =
    This means the same as not setting it at all. (This was documented wrong in versions 4.0.X, 4.1.0 and 4.1.1)

  • Set DENYTOPICVIEW =
    Since TWiki 4.0 this means do not deny anyone the right to view this topic. If DENYTOPICVIEW is set to an empty value anyone has access even if ALLOWTOPICVIEW or ALLOWWEBVIEW is defined. This allows to have very restrictive default access rights to an entire web and still allow individual topics to have more open access.

The same rules apply to ALLOWTOPICCHANGE/DENYTOPICCHANGE and APPLYTOPICRENAME/DENYTOPICRENAME. Setting ALLOWTOPICCHANGE or ALLOWTOPICRENAME to en empty value means the same as not defining it. Setting DENYTOPICCHANGE or DENYTOPICRENAME to an empty value means that anyone can edit or rename the topic.

ALERT! The setting to an empty has caused confusion and great debate and it has been decided that the empty setting syntax will be replaced by something which is easier to understand in the 4.2 version of TWiki. A method to upgrade will be provided. Please read the release notes carefully when you upgrade.

See "How TWiki evaluates ALLOW/DENY settings" below for more on how ALLOW and DENY interacts.

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,

    ScriptAlias /twiki/bin/ /filesystem/path/to/twiki/bin/
    Alias /twiki/pub/       /filesystem/path/to/twiki/pub/

    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/+twiki/+pub/+TWiki/+.+
    RewriteRule ^/+twiki/+pub/+([^/]+)((/+([^/]+))+)/+(.+) /twiki/bin/viewfile/$1/$2?filename=$5 [L,PT]

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.

Controlling who can manage top-level webs

Top level webs are a special case, because they don't have a parent web with a WebPreferences. So there has to be a special control just for the root level.

  • You can define these settings in the Main.%TWIKIPREFSTOPIC% topic, preferable towards the end of the topic:
    • Set DENYROOTCHANGE = < comma-delimited list of Users and Groups >
    • Set ALLOWROOTCHANGE = < comma-delimited list of Users and Groups >
Note that you do not require ROOTCHANGE access to rename an existing top-level web. You just need WEBCHANGE in the web itself.

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 an administrator
    • access is PERMITTED.
  2. If DENYTOPIC is set to a list of wikinames
    • people in the list will be DENIED.
  3. If DENYTOPIC is set to empty ( i.e. Set DENYTOPIC = )
    • access is PERMITTED i.e no-one is denied access to this topic.
      ALERT! Attention: Use this with caution. This is deprecated and will likely change in the next release.
  4. If ALLOWTOPIC is set
    1. people in the list are PERMITTED
    2. everyone else is DENIED
  5. If DENYWEB is set to a list of wikinames
    • people in the list are DENIED access
  6. If ALLOWWEB is set to a list of wikinames
    • people in the list will be PERMITTED
    • everyone else will be DENIED
  7. 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 WebPreferences:

  • Set 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.

ALERT! Note: Obfuscating a web without view access control is very insecure, as anyone who knows the URL can access the web.

Restrict Access to Whole TWiki Site

For a firewalled TWiki, e.g. an intranet wiki or extranet wiki, you want to allow only invited people to access your TWiki. In this case, enable user authentication with ApacheLogin and lock down access to the whole twiki/bin and twiki/pub directories to all but valid users. In the Apache .htaccess file or the appropriate .conf file, replace the <FilesMatch "(attach|edit|... section with this:

<FilesMatch ".*">
       require valid-user
</FilesMatch>

If needed, you can further restrict access to selected webs with ALLOWWEBVIEW and other access control settings.

Note: With this configuration, someone with access to the site needs to register new users.

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. Set require valid-user on your view script in .htaccess or the appropriate Apache .conf file. As of 4.x, this looks like: FilesMatch "(attach|edit|manage|rename|save|view|upload|mail|logon|.*auth).*" (normally view is not in that list).
  2. Restrict view access to selected Users and Groups. Set one or both of these variables in its WebPreferences topic:
    • Set DENYWEBVIEW = < list of Users and Groups >
    • Set ALLOWWEBVIEW = < list of Users and Groups >
    • 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 if DENYWEBVIEW and ALLOWWEBVIEW are not defined.
  3. If you still want public users to be able to register automatically follow TWiki:TWiki.RegisterOnViewRestrictedSite.

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 WebPreferences topic:
    • Set DENYWEBVIEW = < list of Users and Groups >
    • Set ALLOWWEBVIEW = < list of Users and Groups >
    • 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 if DENYWEBVIEW and ALLOWWEBVIEW are not defined.

Hide Control Settings

TIP Tip: To hide access control settings from normal browser viewing, you can put them into the topic-local settings. You can access those settings via the "More" screen, as explained in TWikiVariables.

Alternatively, place them in HTML comment markers, but this exposes the access setting during ordinary editing.

<!--
   * Set DENYTOPICCHANGE = Main.SomeGroup
-->

Related Topics: AdminDocumentationCategory, TWikiUserAuthentication, TWiki:TWiki.TWikiAccessControlSupplement

-- Contributors: TWiki:Main.PeterThoeny, TWiki:Main.MikeMannix, TWiki:Main.CrawfordCurrie



Comments & Questions about this Distribution Document Topic

Regarding the last warning (Authenticating webs is not very secure), it would be useful to know the why behind this statement. Without the why, it's hard to make an informed decision whether to authenticate webs. Thanks.

-- MartyBacke - 30 May 2002

  • I agree with this. I'm assuming that using apache+ssl+htaccess+viewauth should be secure. What is meant by saying "a way to circumvent the read access restriction"? -- DougAlcorn - 03 Jul 2002

In the section on adding viewauth to the htaccess file, can we get an example of the htaccess file so configured? I find it a bit confusing.

-- RalphBroom - 31 May 2002

  • There is a sample .htaccess.txt file that comes with the 01 Dec 2001 release of TWiki. All you need to do is s/view/viewauth/ as far as I can see. -- DougAlcorn? 03 Jul 2002

  • In "Authenticate and Restricting Selected Webs Only" section of this topic, 5) means you have to add three lines in .htaccess :
<Files "viewauth">
       require valid-user
</Files>
  • The "not very secure" stuff is simple (from my experience) : when a user views a restricted Web, the server keeps his IP address and associates it with his WikiName in remoteusers.txt file. After that if someone can take the same IP address, he can view (but not edit) the restricted Web without authentication. If the first user use a proxy, everyone using the same proxy will be able to see the restricted Web.
-- PhilippeBricout - 04 Jul 2002

I experimented with using cron to delete the remoteusers.txt every so often. While it worked, it was not ideal. Then I went back and turned off the IP logging in TWiki.cfg. This gave the results I wanted, although I can't explain why (and in fact I think it maybe should not have worked). It seems that now viewauth authentication is simply working on a per-session basis (yet, I am not using the 'session' plugin). Your results could vary. -- BobNewell - 30 Nov 2002

-- DanielWeiss - 08 Oct 2002

I have problems with the TWikiUser? Authentication. I want that only my registered users can edit/view in the twiki and that they have to authenticate like here with username/password. How does that work?

BobNewell - 30 Oct 2002

See /bin/.htaccess.txt file in your distro how authorisation works - like require valid-user for viewauth above.

(I also fixed signature for BobNewell)

-- PeterMasiar - 01 Dec 2002

The documentation never explicitly mention that read access restrictions do not protect attachments, even if their topics are restricted and secured. See AttachmentsUnprotectedByReadAccessRestriction for more info. This is a pretty serious security flaw (or a pretty serious misconfiguration on my behalf if I missed something here smile ).

-- StefanLindmark - 16 Dec 2002

In the setup instructions above, "*Copy* the view script to viewauth (or better, create a symbolic link)", using a symbolic link would require a slight change to httpd.conf configuration instructions for the /twiki/bin directory, i.e., +FollowSymLinks.

-- AnthonPang - 31 Dec 2002

Hi Anthon. Version control exists for a reason. If you know exactly what needs changing, can you simply update whatever needs updating? If there's something that's wrong that needs to be updated for the release, now is indeed the time! Thanks.

-- GrantBow - 17 Jan 2003

The various options for authenticating and securing access and editing sure are confusing, especially in text form. I'm mulling over something more tabular like this (neither exhaustive nor correct example!):

Login Required to View Login Required to Edit Then Do This
no no (default installation; do NOT rename htaccess.txt to .htaccess)
no yes rename htaccess.txt to .htaccess. Add a require valid user for the "edit" script
Delete TWikiGuest? from .htpasswd if you wish to disallow anonymous edits
yes yes rename htaccess.txt to .htaccess. Add a require valid user for the "view" and "edit" scripts

etc. Comments, thoughts? Perhaps move the options to different topics ("FullyOpen","FullyRestricted", etc.)

-- BruceMcKenzie? - 09 Apr 2003

Fixed table above a little - hope correctly wink

-- PeterMasiar - 10 Apr 2003

This table is a good suggestion. This is however a user authentication question, not a access control question. I updated TWikiUserAuthentication accordingly.

-- PeterThoeny - 14 Apr 2003

I am confused: ManagingWebs says, that it's not possible to rename or delete a web through browser.

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

I think, this should rather read "You can define who is allowed to rename, move or delete a topic on individual web level or on topic level."

Likewise the text You can define restrictions of who is allowed to rename a TWiki web. is also misleading as you can only configure who is allowed to rename a topic on individual web level using the variables DENYWEBRENAME and ALLOWWEBRENAME.

What do you think? Cheers

-- DanielKabs - 23 Apr 2003

  • Would anyone be offended if I put "---" bars between everyone's posts?  There are some places where I find it difficult to keep track of who said what.
  • OTOH (4 fingers & a thumb?), maybe just fixing the few places where the sig block is not on a new line would do the trick.

-- RickArchibald - 04 Nov 2003

Initially we had horizontal bars but found them too distracting. There is enough visual clue if the signature has an empty line before and after it. See also SignatureNetiquette.

-- PeterThoeny - 05 Nov 2003

I've followed the instructions for "Authenticate and Restricting Selected Webs Only", but when I go to my wiki after restarting my browser, I'm asked to login, no matter which of my webs I go to! I'm not sure why, but the links to bin/view on all webs are linking to bin/viewauth for some reason. I've double checked the preferences in all they webs, and only one web has the ALLOWWEBVIEW set for a certain group. Removing that one condition makes all webs readable. Setting that condition makes all webs require login. Any ideas?

-- DavidGrant - 18 Oct 2004

I remember I had the same problem as David some time ago. But I cannot recall what I did to fix it. Frankly to say, I got rid of many troubles before I finally set up Twiki as I want. Twiki is the most versatile as well as most difficult wiki engine for installation and usage I have ever tried. It should be made easier by any means.

-- ChunhuaLiao - 26 Oct 2004

David, you problem sounds alot like one I ran into but thought it was browser related. Perhaps not. See the discussion and possible fix at SafariBrowserIssues#PatternSkinFix.

-- LynnwoodBrown - 27 Oct 2004

I happen to have exactly the same problem as David. The add-on in my case is, that only webs, which have been already existing (TWiki, Main and Sandbox), are affected by that problem. New webs can be still accessed (except when they are also restricted). I checked the support web and the TWiki documentation for advice but could not find any hint, that would help me. Has anyone any ideas on that problem? I would realy appreciate some help.

-- AndreaLazarescu - 08 Nov 2004

The SuperAdminGroup is misleading. It states:

_"The default setting is not to have superusers."_

But the default TWiki.cfg that comes with Cairo, and is also in the MAIN branch are:

$doSuperAdminGroup = "1";
$superAdminGroup    = "TWikiAdminGroup";

So, the default IS to have superusers. The only thing that hints that there are no superusers by default is that TWikiAdminGroups? only have PeterThoeny as a member.

-- RafaelAlvarez - 24 Nov 2004

VickiBrown, thank you very much for helping to keep the system docs up to date. I changed the link to the support web HowtoHideTextFromView to an InterWiki? link because this TWikiAccessControl topic is packaged into twiki releases but the support web is not, becoming a broken link.

-- MattWilkie - 01 Dec 2004

I felt that the comments in regards to the "Authentication and Restricting Selected Webs" is slightly ambiguous, specifically the comment that authenticating webs is not very secure because read access can be circumvented. Does authentication refer only to granting read permissions to the particular web for registered users, or does it include all of the steps in setting the WebPreferences NOSEARCHALL variable and using the .htaccess to control access to the viewauth file?

My interpretation of the current documentation is that if you perform the steps involving the .htaccess file and the NOSEARCHALL variable, the content will be protected from unauthorized read access and from search engine crawlers.

-- SeanLau - 08 Feb 2005

This documentation makes no mention of how FINALPREFERENCES affects precidence, or the relative precidence of WEB and TOPIC settings.

-- SamHasler - 28 Feb 2005

Changed the parts on renaming as they were misleading (see DanielKabs) comment above: renaming of a web is not possible from within TWiki. Instead the variable "ALLOWWEBRENAME" defines a web specific default for topic rename access.

-- FelixKaiser - 03 Mar 2005

Now that we made this clear, wink I have another question: At the top of this document is an explanation of how to set variables for access control: "Make sure you have three space plus * and an extra space ahead of any access control rule if it does not act as you want." On the other hand, WebPreferences says:" A preference is defined as: 6 spaces * Set NAME = value".

What is correct?

-- DanielKabs - 21 Apr 2005

I have added ALLOWTOPICCHANGE and ALLOWTOPICCHANGE and set both to twikiadmingroup. The permissions are working. But I (as a twikiadmingroup member) cannot view the differences between revisions. Any help would be greatly appreciated.

Update: The "| r1.12 | > | r1.11 |" when I mouse over on the ">" it is calling diff, even on a topic that requires authentication. It should be calling rdiffauth. How do I change that?

Thanks

-- TroyKnabe - 10 May 2005

Regarding the 3 spaces vs 6 spaces question, looking at the code for 20040902, TWiki::Prefs seems to look for /^\t+\*\sSet\s/ (and every 3 spaces of indentation get converted to a \t on storing the topic in TWiki::UI::Save::_save()), whereas TWiki::Access looks for /^\s+\*\sSet\s/.

So in short, web/site preferences are handled differently to per-topic access restrictions (why?), but 3 or 6 spaces (or any multiple of 3) will always work.

Hope I got that right smile

-- AdamSpiers - 17 May 2005

How do I DENYWEBVIEW to TWikiGuest for the /TWiki/ web without setting DENYWEBVIEW for TWikiGuest to the rest of my webs? I've tried setting ALLOWEBVIEW = TWikiGuest in individual webs and DENYWEBVIEW = TWikiGuest in both TWiki/WebPreferences and TWiki/TWikiPreferneces, and I still can't lock out the TWiki web to anoymous access

-- WallaceWinfrey - 19 May 2005

I have an access problem. All webs need authentication, public or not. When I directo to view script, is redirected to viewauth. I'm using Koalaskin and have. I've read the topic about authentication on main topic, done all the stuff and the same problem. Any ideas? Thanks

-- AlfredoRuiz - 23 Jun 2005

TWiki's lack of access control is more and more a problem for me with TWiki at Intel. I am highly encouraged (compelled, forced) to use SharePoint? , which uses fairly good, fairly standard, access control on a per item basis, rather than TWiki.

Yes: I want to put highly sensitive stuff in a TWiki (or on SharePoint? ).

But, for generating content, SharePoint? sucks.

I'd appreciate any pointers to wikis that have better access control. I think I remember ZWiki did; I would guess that the wikis build around databases have whatever access control and authentication the database provides.

I'd love to find a good wiki plugin for SharePoint? , where every item posted was a separate web item, and hence could have distinct permissions.

-- AndyGlew - 24 Jun 2005

    Allow me to update this comment: eventually Intel's sysadmins agreed to semi-suppot TWiki. They do not actually do any work inside the TWiki site, but they give us the appropriate Apache mappings. Plus, they set up a web based authentication mechanism that uses the standard Microsoft Windows login, idsid/password, and then passes on to TWiki. (Corporate security meant that I could not administer such a login - they do not want non-IT people to have exposure to other people's passwords.)

    Lossage:

    • frown users dislike that they have to type in their MS Windows password to get to the TWiki. but at least password manager handles that...
    • frown it is awkward to have TWiki stuff that is world readable. The sysadmins need to maintain separate public Apache mappings for each such TWiki. E.g. I asked them to arrange for one particular web to be public, without requiring a password to access - but the sysadmins goofed up on the Apache mappings, and eventually I settled on just requiring everyone to log in.
    • smile but at least, once folks have logged in and they have registered, I can set up ACLs to have some modicum of access control.
      • frown most users do not want to bother with registering with the TWiki site. So the Microsoft Windows domain/login is what TWiki sees... but TWiki is inconsistent about using this in things like ACLs.
      • I have ended up registering most users myself...

    -- AndyGlew - 28 Apr 2006

If I put DENYVIEW for TWikiGuest? it doens't force the user to log on, it only sends the access control 401 message.

In some situations prompting for the login is what is required, but there is no way for the admin or topic creator to set viewauth or require valid-user for a specific topic within the topic, using the browser, using the current access control model. He has to "step outide" and edit the .htaccess file on a topic by topic basis.

Or is there a solution I've missed?

-- AntonAylward - 28 Jun 2005

I'm a little lost here. I've installed the TWiki on my site, following the instructions. But I cannot change the settings because TWikiAdminGroup? is set to include only Peter Thoeny, and I can't edit that because I'm not in the Admin Group. Is there some installation step I've missed?

Can't the default for a new installation be to let everyone edit everything, like, you know, in a Wiki?

I also can't register because the server can't send me email because I can't edit the email server settings because I'm not in the admin group...

Argh.

-- BenjaminRosenbaum - 23 Aug 2005

basically, the default install needs to be a little secure, as we store configuration info in topics. so no, TWiki is a little bit to powerful to allow anyone to edit all topics. you're going to need to edit TWikiAdminGroup? .txt outside TWiki

-- SvenDowideit - 23 Aug 2005

Mh, I don't get this. I just installed as fresh TWiki and my Main.TWikiAdminGroup was editable, because Set ALLOWTOPICCHANGE = TWikiAdminGroup? was commented out.
What am I missing here?

-- DanielKabs - 23 Aug 2005

That is the idea, the commented out access control should be enabled after authentication is working and admins are registered and in the group. As Sven points out, you need to edit the topic on the shell level if you lock yourself out.

-- PeterThoeny - 24 Aug 2005

Apropos Authenticate and Restricting Selected Webs Only. Using TWikiRelease04Sep2004, I made some experience contrasting what is written above. I'd like to know if I am seeing extraterrestrial artifacts or if I can change the documentation accordingly:

  1. I restricted view access to Main web to authenticated users (Set DENYWEBVIEW = TWikiGuest in WebPreferences). Although I left NOSEARCHALL untouched (i.e. unset), unauthenticated users can not search Main web across from other webs. So maybe step 2) is not necessary? Hypothesis: Hiding a web from "all web search" enables restricted users to still use all other webs?
  2. I had to disable the $doRememberRemoteUser flag in lib/TWiki.cfg in order to get authentication working properly. Reason: my users access TWiki through proxy server and thus TWiki always sees the same IP address. Also regarding PhilippeBricout's comment, security considerations should make disable the recommended practice in step 3).
  3. view and viewauth are the same file, so why does step 4) instruct me to copy it over? supposition: just to make sure they are?
  4. viewauth (by default) is already in the .htaccess file. To minimize confusion, step 5) should mention that this change applies only if .htaccess has been manipulated beforehand.
  5. I had to add rdiff to the list of authenticated scripts (in bin/.htaccess) to get the diff link (the > between revision numbers in the bottom navigation bar) working.

In case of Authenticate all Webs and Restrict Selected Webs: Should the viewauth script be listed in the .htaccess file, too (step 3)?

I'd like to know: what a difference does it make internally if either viewauth or view (accordingly rdiffauth or rdiff) is listed as authenticated script?

-- DanielKabs - 10 Jan 2006

If you disable $doRememberRemoteUser and are not using session tracking by cookies, then everyone will be a TWikiGuest in view, e.g. the setup you discribe cannot work unless you authenticate the view script (and thus require everyone to login to look at content.)

-- PeterThoeny - 11 Jan 2006

For the reasons I described above, I had to disable $doRememberRemoteUser and you are right, my setup is not yet working 100%: bin/search never returns anything and fails to display LeftBar? . Adding search to bin/.htaccess (same as with rdiff in step E. above) fixed this. It works, although view is not yet authenticated.

  • Update: Peter, you are right, I have to include view in the .htaccess file so links from a %TOC% do not get redirected. -- DanielKabs - 23 Jan 2006

I think this setup may be relevant for other users, too. So when it turns out to be set up correctly, I will update the docs here (it's a wiki, isn't it smile ). Any help about "session tracking" and "authenticating scripts" (what difference it makes although normal and auth scripts are the same) is appreciated.

moved your comment about doc updates workflow to CoffeeBreak#How_changes_in_Twiki_propagate

-- DanielKabs - 11 Jan 2006

I've got spammers making user pages on my Wiki. They don't get an entry in .htpasswd, so I assume they are making users with no passwords. I delete the pages as fast as they're being added, but it's a pain. Is there any way to require an email verification before a new user gets created, like we do with mailing lists?

-- PaulTomblin - 01 Feb 2006

This is a support question, not a documentation feedback. Please ask in the Support web.

-- PeterThoeny - 01 Feb 2006

I think I am a fairly experienced guy, but I can't figure out how to securely set this up based on the confusing documentation. Here is what I want to do.

1. An account is required to even browse ANYTHING on the site, including documentation or reference guides.

2. Users can not register for an account themselves; they must contact the Wiki administrator offline to have their account created.

I can't seem to figure this out. This guide talks about ALLOWWEBVIEW and DENYWEBVIEW, but it doesn't give any real-world examples of how to set them up. Simply showing me doesn't tell me anything - what users go where? For example, I removed all access but then the registration form stopped working because the Guest account could not read it.

Has anyone set this up? If so, what are the sample access permissions you used? Thanks in advance.

-- RobertJBrown - 26 Apr 2006

Your desired setup has nothing to do with the TWiki access control setting described here. It is an Apache configuration question. Please ask in the Support web where we will handle this custom setup question.

-- PeterThoeny - 28 Apr 2006

Can anybody here help me, I am interested in TWiki'ing and ofcourse I am new to TWiki, But the problem is - I am unable to customize my TWiki - I mean to say that I had deployed TWiki on Apache - It is not allowing me to customize my own image even. It is just posing me with an "Access Denied"... Please help me to resolve this issue.

-- RadhakrishnaUppaluri - 15 May 2006

Please ask support questions in the Support web (after reading the SupportGuidelines).

-- PeterThoeny - 15 May 2006

Note that the Apache rules for protecting attachments with viewfile have been made safer. Thank you to BenWheeler for spotting this and provinding a better regex.

-- KennethLavrsen - 27 Jul 2006

I think there's an error in the access control description for individual topics. Under "Controlling access to a Topic", it says "You can define these settings in the WebPreferences topic [..]". I think that this is incorrect, because the WebPreferences only consider preferences for the web. Correct in my opinion is "You can define these settings within the individual topic (you want to control access for) [...]". Shall I just change it above?

-- FelixKaiser - 12 Oct 2006

Thanks Felix, I updated the doc. This is a wiki, so please feel free to improve/fix the docs as needed!

-- PeterThoeny - 13 Oct 2006

The documentation on version TWiki-4.1.1, Mon, 05 Feb 2007, build 12770 has removed the options for renaming: ALLOWWEBRENAME and ALLOWTOPICRENAME, yet without these, deleting an attachment -among other actions, is not possible.

-- RafaelCaceres - 15 Feb 2007

This is tracked in Bugs:Item3642

-- PeterThoeny - 15 Feb 2007

Hi all, Can I use different authorization for different Web? Can I use Active directory groups, those already exist under my domain, for accessing Web. Can we set permission like

Set ALLOWTOPICVIEW = domainname\group

or like

<> require group domainname\group </> in .haccess file.

I want to achive that, ThisWeb? is accessed by ThisGroup? only that too belong to winodws/active directory group. I am using SSPI module for authentication. Log on using domain ID/PWD.

Thanks

-- RahulH - 22 Mar 2007

Please ask support questions in the Support web.

-- PeterThoeny - 24 Mar 2007

How does access control affect INCLUDE? For example, does restricting VIEW for a toipc prevent one from INCLUDEing it? If it doesn't then can't one include a topic to bypass the VIEW restriction? Suggest some documentation in this area...

-- RobertWithrow - 29 Mar 2007

Good point, created Bugs:Item3821. (Access control can't be circumvented in INCLUDE, it works properly.)

-- PeterThoeny - 29 Mar 2007

I'm only two days old. Uh, in TWiki experience, that is. I was trying to figure-out how this "granular access control" stuff works - I wanted to restrict editing on specific pages. With a preponderance of very general documentation, I was left to experimentation (not drugs, that was in the '60s). I hope the following is found useful by other less-than-a-week olds:

At the bottom of a specific page on which I wanted to restrict editing, I added:

<!--
   * Set ALLOWTOPICCHANGE =  Main.TWikiAdminGroup
   * Set DENYTOPICCHANGE = Main.NobodyGroup -->

Note that putting this inside an HTML comment hides it from your fabulously formatted page, but the TWiki Gods still see them, and obey your wishes.

Thanks to all who work so hard, so others can drink coffee.

-- TerrillBennett - 13 Jun 2007

Thanks for the feedback, enlightening funny!

For access control, please use only one of ALLOWTOPICCHANGE or DENYTOPICCHANGE, not both. If you want to hide the settings in HTML comments put the comment tags on separate lines.

BTW, please ask support questions in the Support web.

-- PeterThoeny - 14 Jun 2007

Another INCLUDE question: Suppose I have a set of topics that I want to access control identically. Can I INCLUDE the control statements from some other topic, like a topic where I explain the controls and use STARTSECTION...ENDSECTION to delineate them? The use case is to have standardized look-and-feel for controls that include text with contact info. Putting that on each page creates a maintenance nightmare.

-- RobertWithrow - 15 Jun 2007

I meant the above to be a documentation suggestion, as I'm looking at the code to answer the question proper... wink I assume lots of people construct pages out of INCLUDES so the topic of the effect of INCLUDED access controls probably deserves a few words.

-- RobertWithrow - 15 Jun 2007

This topic should also address the situation where there are multiple declarations in a topic. For example, if I have an ALLOWTOPICVIEW for user foo followed by another ALLOWTOPICVIEW for user fee, what happens? Is the first one used? Or the second? Or both?

-- RobertWithrow - 22 Jun 2007

INCLUDE doc tracked in Bugs:Item4289; multiple settings tracked in Bugs:Item4288.

-- PeterThoeny - 23 Jun 2007

A warning should be added to this topic that if users restrict access to the Main web, eg. by setting ALLOWWEBCHANGE = TWikiAdminGroup then the Registration Agent may not be able to create new user topics and registration can fail. This happened to me and it took a while to figure out what the problem was. It was solved by setting ALLOWWEBCHANGE = TWikiAdminGroup, TWikiRegistrationAgent in the Main web.

-- TamsinTweddell - 25 Jun 2007

Tamsin, thanks for mentioning it, I had the same problem a while ago.

The problem with the Restrict Access to Whole TWiki Site recipe for me is, I as an administrator have to assign passwords and users cannot easily change them, which is okay but doesn't look very professional.

Here's a configuration that restricts as much as possible, while still allowing new users to register themselves:

  • Protect all webs, (except perhaps a "Public" web where you can put welcome pages, but including Main and TWiki) using ALLOWWEB... = as described above.
  • Don't forget the TWikiRegistrationAgent? in Main as just mentioned
  • Selectively open TWikiRegistration, NewUserTemplate and UserForm for viewing to all users ("DENYTOPICVIEW =" )
  • Send users the direct registration link

Still under evaluation, but seems to work so far.

-- TimRomberg - 12 Jan 2008

I have TWiki on an intranet with mod_auth_sspi handling the authentication. How can I restrict access to only registered users? Adding DENYWEBVIEW = TWikiGuest? does not help, since users are already authenticated.

-- ParBohrarper - 15 Jan 2008

Please ask support questions in the Support web.

-- PeterThoeny - 17 Jan 2008

Changing

RewriteRule ^/+twiki/+pub/+([^/]+)/+((([^/]+)/+)+)(.+) /twiki/bin/viewfile/$1/$4?filename=$5 [L,PT]

to

RewriteRule ^/+twiki/+pub/+([^/]+)((/+([^/]+))+)/+(.+) /twiki/bin/viewfile/$1/$2?filename=$5 [L,PT]

as it seems the original is not correct, it ignores subwebs and adds a / too many.

-- KoenMartens - 20 Mar 2008

Is this change reflected in SVN?

-- PeterThoeny - 21 Mar 2008

Hmm, no, i'll put that on my todo.

-- KoenMartens - 31 Mar 2008

I had contributed some module call - TWikiAuthen with http://twiki.org/cgi-bin/view/Codev/SecuringAttachments, this may solve the issue. The module is Apache Module, is invoked through request when some one tries to access the "pub" or may be to some perticular Web's pub. It checks the users access rights to the topic where attachment is added - and accordingly gives the access.

-- SopanShewale - 26 Jun 2008

Sopan: Possibly package this as an add-on in the Plugins web?

-- PeterThoeny - 04 Jul 2008

hi there..

We are using tiwki 2004. Now every time user creates his web page, it add on to a huge .acl file that we already are maintaining. Also if user want to modify the restrictions on a page, they have to contact the admin group. I would like to know if it is possible that we could let the user to manage the access to their own pages(pages that they have created) following below criteria.

1. Authentication v's Access Control

Authentication will still have to be done against the our corporate server.

However, the access control should move to the pages themselves. That is, may be we should just be able to add special access-control markup to the pages when editing them.

May be we can stop using .acl file.

To do this, do we need a newer version of TWiki. I don't know for sure. If we need than, how about migrating from TWIki 01 Sep 2004 to the current stable version available from http://TWiki.org.

I have read that upgrading TWiki is not always easy.

Please let me know what should i do ASAP.

Thanks and Regards

-- SapinAmin - 14 Jul 2008

Please ask support question in the Support web. This section is about the documentation.

-- PeterThoeny - 15 Jul 2008

RewriteRule? ^/+twiki/+pub/+([^/]+)((/+([^/]+))+)/+(.+) /twiki/bin/viewfile/$1/$2?filename=$5 [L,PT] Remove the / in $1/$2, as $2 will already have the /.

Also, to restrict access to the entire TWiki site, remove the FilesMatch? directive seems better than putting a .* as a match. It saves one useless match per access.

-- OlivierRaginel - 30 Jul 2008

Is it possible to restrict viewership of only parts of a page? Specifically, certain cells in a table? I would like for certain cells to be hidden from certain users.

-- TWikiGuest - 22 Sep 2008

Please ask support questions in the Support web. Also, please register with your real first name and last name, not with a screen name.

-- PeterThoeny - 25 Sep 2008

 
Topic revision: r119 - 25 Sep 2008 - 06:21:41 - PeterThoeny
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback