Extension:ProtectSection
![]() | This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. If you are interested in taking on the task of developing and maintaining this extension, you can request that the extension be imported into Git. As a courtesy, you may want to contact the author. You should also remove this template and list yourself as maintaining the extension in the page's {{extension}} infobox. |
![]() | 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 |
ProtectSection implements <protect>...</protect> tags that prevent the enclosed text from being modified by editors who are not sysops or bureaucrats (or more generally, do not have the 'protectsection' user right). Attempts by unauthorized editors to edit text between protect tags, to delete protect tags, or to insert protect tags will result in an error message being displayed when the editor tries to save the page.
ProtectSection Release status: unmaintained | |||
---|---|---|---|
Implementation | User rights, Tag | ||
Description | Prevent editing of text embedded in <protect>...</protect> tags | ||
Author(s) | Originally by ThomasV; modified by Jim Hu, Siebrand Mazeland, and Nephele | ||
Latest version | 1.1 (2009-08-29) | ||
MediaWiki | 1.12+ | ||
License | GNU General Public License 2.0 or later | ||
Download | |||
| |||
| |||
| |||
Translate the ProtectSection extension if it is available at translatewiki.net | |||
Check usage and version matrix. |
Contents
Usage[edit]
To prevent unauthorized editors from modifying a section of text, enclose it in <protect>...</protect> tags:
<protect>This is a sentence that cannot be modified.</protect>
Unauthorized editors cannot add protect tags, cannot delete protect tags, and cannot modify the contents of any text enclosed within protect tags. Optionally (see Installation), editors can also be prevented from adding text in front of a protect tag that appears at the start of an article (for example, to ensure that a warning on a user talk page remains at the top of the page).
The protected text can contain entire sections of articles, in which case the usual [edit] tags for those sections are disabled (for unauthorized editors only).
<protect> tags appearing within <nowiki>...</nowiki> sections are effectively ignored (they do not trigger protection of the subsequent text). Similarly, HTML comments (<!--...-->) are also ignored. Note, however, that this can not be used to circumvent protected text: attempts to nowiki or comment out a protected section are treated as deletion of the protection tags, and therefore blocked.
Installation[edit]
The usual: Copy to extensions folder. Add the following to LocalSettings.php:
require_once( "$IP/extensions/ProtectSection/ProtectSection.php");
Optional steps:
- Modify which groups have the 'protectsection' right (and are therefore able to add/remove/modify protected sections). By default, the right is given to the sysop and bureaucrat groups
- Set $egProtectSectionNoAddAbove to true if you want to also prevent text from being inserted in front of a protected section, if the protected section is at the start of the article
Limitations[edit]
- One way to effectively remove a protected section is to enclose the section in certain HTML tags that make the section invisible.
- This loophole can be closed for protect tags that appear at the very beginning of an article, as long as $egProtectSectionNoAddAbove is set to true.
- The 1.0.1 release of this extension included several bugs that made it possible to circumvent protect tags. These bugs are fixed in the 1.1 release, although upgrading does require MediaWiki version 1.12 (because of the EditFilterMerged hook used).
Alternatives[edit]
- Extension:ProtectText allows users to add protection when they are the sole contributors
- Extension:PageSecurity for page level granularity.
- Unmaintained extensions
- Page specific user rights extensions
- GPL licensed extensions
- Not LTS ready
- Extensions without an image
- User rights extensions
- Tag extensions
- Extensions without a compatibility policy
- Extensions in Wikimedia version control
- Extensions which add rights
- EditFilterMerged extensions
- ParserAfterTidy extensions
- ParserBeforeStrip extensions
- PageRenderingHash extensions
- All extensions
- Edit extensions