Extension:ProtectText

From MediaWiki.org

Jump to: navigation, search
If you need per-page or partial page access restrictions, you are advised to install an appropriate content management package. MediaWiki was not written to provide per-page access restrictions, and almost all hacks or patches promising to add them will likely have flaws somewhere, which could lead to exposure of confidential data. We are not responsible for anything being leaked, leading to loss of funds or one's job.
For further details, see Security issues with authorization extensions


Manual on MediaWiki Extensions
List of MediaWiki Extensions
ProtectText

Release status: beta

Implementation User rights, Tag
Description Block editing of marked text, but still allow a sole contributor to work on the full text
Author(s) Loosely based on ProtectSection by ThomasV; modified by John Erling Blad
Last Version unknown (2008-05-28)
MediaWiki 1.11.0 (tested)
License No license specified
Download ProtectText.php, ProtectText.i18n.php

ProtectText adds a tag and some wiki markup to make it possible to protect fragments of text or data from being removed or changed. The reason can be diverse, ranging from a simple statement of a person to a measurement taken by a researcher in a laboratory. The extension makes it possible to protect such fragments of text.

Contents

[edit] Usage

Protected text from the present text will be compared with the previous, and if it differs then the user must have sufficient rights to be able to save the page. This is either given by a basic user rights level when all previous versions of the page are written by one and only one user, or by an alternate and higher level if there are multiple contributors. Normally the user can write on the page without interference in his or her own user space. This makes it possible to write a research-oriented work, and then lock down portions of the work. If a page contains works by multiple contributors, then it will be necessary to let someone with additional and higher righs do the actual protection.

The basic level allows use of the protection markup when no other are writing on the page, and because of this the initial editing should be done in the users own space, and therefore the basic protection levels should be at least similar to the rights to move a page.

The alternate level is where the user must cooperate with other users to protect a page. This will be similar to ordinary protection and should follow the same user rights.

Fundamental operation is to protect large blocks of text, paragraphs of text and small fragments. Large blocks are protected through <protect>, paragraphs through an initial paragraph sign (§), and small text fragments through enclosing the text in a special wiki markup ({§ and §}).

Protecting large blocks

Protecting large sections of text can be done by the tag <protect>. This can span several subparts of the text, even parts in different sections and inside paragraphs.

<protect>This is a tekst with explisitt block-level protection.
Such text can run over several lines or even paragraphs.</protect>
Protecting paragraphs

Most of the time it is better to protect small paragraphs instead for large text blocks. Very often this is small quotes from known sources.

§This is a protected paragraph.
This is not a protected sentence.
Protecting small parts

Very often it is possible to protect only small distinct parts of the text. This can be something like data from a statistical database.

Within this sentence there is a {§protected fragment§}.

[edit] Policy

It is of great importance that there is a clear policy about what and when to protect. If to much of the page is protected then it will become stale and slowly die compared to other articles. If to little is protected it will open up for vandalism that can be very difficult to rectify. Normally a date should be protected, but a description of what happen on that day should not be protected as rewrites would be clearly visible. Likewise a quote of a person can be, and probably should be, protected. An explanation of what this means, or a discourse should not be protected as this might change over time.

An other description of what to protect is that if something is original research without any references it should be protected, and the writer should be used as a reference. If it is public knowledge and can be verified through a reference it should probably not be protected.

[edit] Installation

The usual: Copy ProtectText.php and ProtectText.i18n.php to a subfolder ProtectText in the extensions folder, then add the following to LocalSettings.php:

require_once( "$IP/extensions/ProtectText/ProtectText.php");

Optionally the rights can be changed to limit protectsolecontributor to the group autoconfirmed.

$wgGroupPermissions['*']['protectsolecontributor']  = false;
$wgGroupPermissions['autoconfirmed']['protectsolecontributor'] = true;

[edit] Alternatives

Warning: Default sort key "ProtectText" overrides earlier default sort key "PROTECTTEXT".

Personal tools