Extension:AccessControl

This extension is based on original Extension:Group Based Access Control but without its bugs. Unlike the original double commas aren't used for selection group, only one comma is required. It is not necessary to use the ',,' separator at the end of the element content. It is also possible to use usergroups and internal groups MediaWiki at the same time.

How this extension meets the requirements for site security?
More info about potential problem of security is on page Security issues with authorization extensions. The following points based of the table on this page.


 * Atom/RSS feeds & Diff & revision links : Page content is protected, but when opening the page in the history of a piece of raw content will appear in this. If tag accesscontrol was placed at the beginning, a potential attacker may be to obtain information about names of the access lists of users!


 * Listings & search : If use search uknown or unauthorized user, and search result found in MediaWiki a page with protected content, it is this user redirected away.


 * Inclusion/transclusion & related rights and other extensions : We use AccessControl with extension DynamicPageList. The every page, which has content protected the by AccessControl - is secured, because the content page was controlled before finishing parsing in raw form code.


 * Redirects : The problem with redirection was be repaired in version 1.1


 * API and action links : Each anonymous user has automatically set to false all the action, besides view for a unprotected pages. Allowed actions for the authorized user depends on the permissions settings mediawiki and his username listed in the access list which pages will use.


 * Edit Section and Watching Pages : Options are available only to registered user. If user is logged and member from the security access list.


 * Files & Images : WARNING: The extension AccessControl does not protecting files against direct access via URL! If files can not be publicly available, must be protect at the server level!


 * XML export (Special page Export) : WARNING: AccessControl version < 2.0, was based on the hook, which was not protected from MediaWiki side before exporting in a raw form code the page. Therefore, if you use version AccessControl < 2.0, you must prohibit the special page for export the pages from MediaWiki.


 * Author backdoor : Extension AccessControl have not any backdoor!


 * Caching : I recommend to turn off caching. See the previous paragraphs

Features

 * easy to setup and simple to use
 * no patches, real extension
 * unlimited number of groups
 * Dual mode access control
 * view control
 * edit control, including restrictions on manual edit access when using action=edit in the URL
 * user groups may use any namespace
 * namespaces may be protected by another extension or by this extension only
 * In original Group Based Access Control can be set special namespace "Usergroup:.." only in extension variable
 * mediaWiki sysop-Group may view and edit the protected pages
 * controlled by extension variable
 * access may be granted to multiple groups
 * may be used for access control for internal system groups from MediaWiki in parallel with user groups lists
 * read only access may be granted to for groups and for individual users
 * Unauthorized user can't use search feature to find pages protected by accesscontrol element

Please read about security issues with authorization extensions

Step 1: Local Settings File
NB : See discussion
 * add the following lines to the bottom of your LocalSettings.php:
 * add a name space to the LocalSettings.php file for the purpose of creating groups.
 * See Manual:Using_custom_namespaces for more information.


 * Check (and maybe edit) the settings in AccessControl.php:

Step 2: Create User Groups
User groups are simply standard wiki pages that are part of a namespace other than the default namespace. For ease of use, it is suggested that a specific custom namespace be created for the explicit purpose of managing access control list pages.
 * Create a Wiki-Page with users list in any namespace
 * It is not sufficient to simply create a page with a colon in the name, this extension requires the use of a namespace and one or more pages within namespaces
 * Page Name Example: My:Group
 * The namespace is My
 * The group page is Group
 * This is the name of usergroup
 * Users are added to the group in a bulletlist
 * Page Content Example
 * Presume that the namespace IT exists
 * Create a page in the namespace titled "Department"
 * Create users "John Doe" and "Jane Doe" in the group. The group information is contained on the page "Department".
 * Each user name appears as a list item.


 * User from a group, which have appended string "(ro)" to the name can only read protected Article, but can't edit it. For other group of users you can create memberlist with name Department too, but in other namespace.


 * Tips: To protect namespace IT you can use for example Extension:Lockdown, but you can use element accesscontrol to protect it itself.

Step 3: Additional Access Control

 * In depends on localization your MediaWiki should be created pages to which anonymous or unauthorized users will be redirected. You have create them in advance, because to some of them isn't any access from other page.
 * The safety of the page provides accesscontrol element. And his content. If there isn't any or is empty the page is free accessible for logged users (they can read and edit page). No logged or annonymous user can only read the page.
 * Members from groups in accesscontrol element can edit page, only if the group title in list doesn't have added string "(ro)", or if they don't have set readonly access in their user grouplist.
 * If it is set the variable  to true, you can use for managing access the internal groups from MediaWiki too.
 * If it is set the variable  to false, only members from  'sysop'  group can edit usergroups pages in any namespace.
 * Example:


 * In this example all users from the groups "Administrators", "IT:Department" and "Sales" can read the page but only the users from "Administrators" MediaWiki group (if exists) and John Doe from "IT:Deparment" usergroup can edit it.

Usage on Pages to Control Access
That is for the installation. To restrict access on a page for specific usergroups, just include the names of the allowed usergroups (separated by commas) as the content of accesscontrol tag in the body of that page. Thus, if you wanted to restrict access to the people with groups "Administrators", "IT:Department" and "Sales", you would use the following syntax: &lt;accesscontrol&gt;Administrators,IT:Department,Sales (ro)&lt;/accesscontrol&gt;

IT:Department is usergroup, and groups Administrators and Sales may be added by Extension:GroupPermissionsManager. Members from group Sales page can read only.


 * Tips: If it is set true  variable, the element accesscontrol is replaced by warning message.

For version <= 1.3

 * Groups from MediaWiki must be in not localized form! In ex.  'sysop'  not  'Správce' , etc.
 * On page may be more accesscontrol elements. Access is accepted for groups from all.tags
 * Anonymous user has not access on pages protected by accesscontrol elements
 * Pages without protection can anonymous user only read
 * Logged user has access on protected page only when he is member of any group with access rights on page
 * If is set in extension script variable  on true, have members from group  'sysop'  edit access on page always

For version >= 2.0

 * From version 2.0 extension not use groups from wiki (without sysop), only groups created by users access lists!
 * On page may be accepted only one accesscontrol elements.
 * If the user is a member of multiple groups, so that takes precedence, which gives greater rights him.

Example
See an example of this add-on in action at: http://support.dce.felk.cvut.cz/mediawiki/index.php/Support run by the author)

Unfortunately the main page does not have an English version, which make it difficult to see the extension in action.

MediaWiki Version

 * Version 2.0 was tested on MediaWiki version 1.19-alpha (from svn repository)
 * Version 1.2 was tested on MediaWiki version 1.15.5-1 (from Debian repository)
 * Version 1.1 was tested on MediaWiki version 1.16.0(b3). Works fine, except that it needed a minor change to line 358 of AccessControl.php (remove '&' from parameter to function controlEditAccess ). When viewing a page on a Linux server, the tags show. But on a Windows server, the tags don't show and it is fine! Still haven't figured that one out, but it is ok for my application.
 * Version 1.1 was tested on MediaWiki version 1.15
 * Version 1.0 of this extension has been tested and works fine on MediaWiki versions > 1.12.x.
 * Version 1.1 tested on MediaWiki version 1.16.1 with new patch from http://git.felk.cvut.cz/pub/git?p=accesscontrol.git;a=commitdiff;h=2f678deed0e4e4f77620e391c94559c7b50102a9