Extension:AccessControl/cs

Rozšíření AccessControl umožňuje omezit přístup k vybraným stránkám na základě interních skupin, nebo seznamů uživatelů vytvářených přímo uživateli.

MediaWiki není navržená jako CMS (Content Management System), který by umožňoval sofistikovanější nastavení práv, proto se to musí tam, kde je požadavek na ochranu citlivých dat, např. při nasazení v korporátní sféře, nebo na školním intranetu, řešit pomocí rozšíření. A právě pro tento účel bylo vytvořeno rozšíření AccessControl.

How this extension meets the requirements for site security

 * Atom/RSS feeds, diff, & revision links : Page content is protected, but when opening a page from history a piece of raw content will appear. If the &lt;accesscontrol> tag was placed at the beginning, a potential attacker may be able to see the names of contributing users!


 * Listings & search : Unless otherwise noted, if there is any page with protected content in search results, the user is redirected away. Since extension version 2.5, searching may be allowed too. But it should be borne in mind that the displayed search results can compromise sensitive data. Therefore, do not write in your wiki sensitive information, such as passwords, that could be obtained through a fulltext search if searching through the contents of pages protected through an access control is allowed!


 * Inclusion/transclusion, related rights, & other extensions: Pages containing the &lt;accesscontrol> tag, or including another page protected by the &lt;accesscontrol> tag, are secure. The &lt;accesscontrol> tag is processed in raw wikitext before HTML conversion.


 * Přesměrování : Problém s přesměrování byl opraven ve verzi 1.1


 * API & action links: For each anonymous user the action class is automatically set to false, besides the view attribute for unprotected pages. Allowed actions for authorized users depend on the permissions settings of MediaWiki and the username listed in the access list pages use.


 * Edit Section & watching pages: Options are available only to registered users if they are logged in and are on the security access list.


 * Files & images : Warning: The extension AccessControl does not protect files against direct access via URL! If files cannot be publicly available, they must be protected at the server level!


 * XML export (Special:Export) : Warning: AccessControl version < 2.0, was based on a hook unprotected from MediaWiki's side before exporting pages to raw code. Therefore, if you use AccessControl version < 2.0, you must prohibit the special page to prohibit exporting the pages from MediaWiki.


 * Autorova zadní vrátka : Rozšíření AccessControl nemá žádná „zadní vrátka“ (backdoor)!


 * Kešování : Doporučuji pokud možno vypnout kešování stránek. Viz předchozí odstavec.

More info about potential problems regarding security is on the page Security issues with authorization extensions.

Features

 * Easy to set up and simple to use.
 * No patches to MediaWiki core.
 * Unlimited 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 with group lists may be protected by another extension.
 * MediaWiki sysop group may view and edit the protected pages.
 * Controlled by extension variable
 * Access may be granted to multiple groups
 * Read-only access may be granted to both groups and individual users.
 * Unauthorized users can use the search feature only if is it allowed. See how this extension meets the requirements for site security.

Dokumentace
Stáhněte si rozšíření z https://github.com/wikimedia/mediawiki-extensions-AccessControl. A umístěte do adresáře, kde má vaše mediawiki uložená rozšíření.

Krok 1: soubor Local Settings

 * Přidejte na konec vašeho souboru LocalSettings.php následující řádky:
 * Add a namespace to the LocalSettings.php file for the purpose of creating groups.
 * See Manual:Using_custom_namespaces for more information.


 * Check the settings in AccessControl.php. These can be set in LocalSettings.php:

Krok 2: Vytvoření skupiny uživatelů
* This method has changes in the latest version, please see note 1 at the bottom of this page. (User lists must be stored in the main namespace).

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 is created for the explicit purpose of managing access control list pages.
 * Create a wiki page with a 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 user group
 * Users are added to the group in a bulleted list
 * 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 username appears as a list item.


 * User names listed with "(ro)" at the end can only read the protected article, not edit it. For other groups of users, you can create another member list with the name Department in another namespace. Note that the user's name must start with a capital letter!


 * Tips: To protect the IT namespace you can use the Lockdown extension, but you can also use the &lt;accesscontrol> tag to protect it.

Krok 3: Použijeme Access Control

 * Depending on localization, your wiki needs pages created to which anonymous or unauthorized users will be redirected. You have to create them in advance because some of them can't access pages from another page.
 * The safety of the page is provided by the &lt;accesscontrol> tag. If there isn't a tag or the page is empty, it's freely accessible to logged-in users that can read and edit the page. No user, logged in or anonymous, will have read-only access.
 * Members from groups listed in the &lt;accesscontrol> tag can edit the page only if the group title isn't listed with "(ro)" and if they don't have read only access set in the group member list.
 * By default the variable  is set to true so that members of  'sysop'  can edit user group pages in any namespace.


 * Example tag code :

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

Usage on Pages to Control Access
That is for the installation. To restrict access to a page for specific user groups, just include the names of the allowed user groups (separated by commas) as the content of the &lt;accesscontrol> tag in the top of the content page.

Pozor
Je důrazně doporučeno použít verzi 2.5.1.

Pro verzi < 2.3

 * Zde se objevil problém ve funkci fromTemplate, který způsoboval, že AccessControl neakceptoval tag z vložených stránek či šablon. Aktualizace je doporučena!

Pro verzi ≥ 2.0
Chcete-li vidět, jak to funguje klikněte sem.
 * Stránky nemohou mít více než jeden &lt;accesscontrol> prvek.
 * Pokud je uživatel členem více skupin, je akceptována skupina která poskytuje vyšší práva.
 * Toto rozšíření používá MediaWiki hook který se volá i při zobrazování výsledku vyhledávání. To znamená, že stránka, která obsahuje tag pro ACL, zavolá zprávu "Přístup odepřen" i v případě, že je nalezen text na chráněné stránce, ke které uživatel nemá práva. Ačkoli to není skutečná chyba, je to nežádoucí chování. Jednoduchým řešením je umístit stránky, které používají ochranu AccessControl, do jiného jmenného prostoru a poté zakázat jeho prohledávání

Pro verzi ≤ 1.3

 * Groups from MediaWiki must not be in localized form!  'sysop'  cannot be  'Správce' , etc.
 * A page may have multiple &lt;accesscontrol> elements, with access accepted from groups in any tag.
 * Anonymous users do not have access to pages protected by &lt;accesscontrol> elements.
 * If variable  is true, sysops always have edit access.

Verze MediaWiki s nimiž bylo rozšíření otestováno

 * Verze 2.5.1 byla testována na MediaWiki 1.33.0-alpha (5eb97ec)
 * Verze 2.6 byla testována na MediaWiki 1.27.0-rc.0 (57f722a)
 * Verze 2.5 byla testována na MediaWiki 1.27.0 (z git repozitáře)
 * Version 2.5 was tested on MediaWiki 1.22.9 (from git repository)
 * Version 2.3 was tested on MediaWiki 1.22.0 (from git repository)
 * Version 2.2 was tested on MediaWiki 1.22.0 (from git repository)
 * Version 2.0 was tested on MediaWiki 1.19-alpha (from svn repository)
 * Version 1.2 was tested on MediaWiki 1.15.5-1 (from Debian repository)
 * Version 1.1 was tested on MediaWiki 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 1.15
 * Version 1.0 of this extension has been tested and works fine on MediaWikis > 1.12.x.
 * Version 1.1 tested on MediaWiki 1.16.1 with new patch from http://git.felk.cvut.cz/pub/git?p=accesscontrol.git;a=commitdiff;h=2f678deed0e4e4f77620e391c94559c7b50102a9

Historie
První verze tohoto rozšíření (1.x) vycházela z rozšíření Group Based Access Control, ale neměla žádnou z jeho chyb.