Release status: beta
|Description||Straightforward per-user per-right per-page protection|
|Author(s)||Pavel Astakhov (pastakhovtalk)|
|Compatibility policy||For every MediaWiki release that is a Long Term Support release there is a corresponding branch in the extension.|
|License||GNU General Public License 2.0 or later|
|Translate the UserProtect extension if it is available at translatewiki.net|
|Issues||Open tasks · Report a bug|
The UserProtect extension provides straightforward per-user per-right per-page protection. It allows those with the
userprotect right (administrators by default) to use a page protection tool that is similar to the way the core MediaWiki Protect action works. It allows adding rights or removing rights on a per-page basis. It cannot restrict the viewing of any pages.
This extension was created for WikiWorks.
- Stores its data in the MediaWiki database.
- Doesn’t disable caching.
- Has a minimalist interface
- Adds and removes rights on the fly.
- Overrides the built-in core per-group protection system with finer per-user protection.
A user with the
userprotect right is provided with the "User protect" item in the page actions menu. Click it to add or remove allowed restrictions to the current page on per-user basis. Just start typing user names in the appropriate right field. Each field allows multiple values and autocompletes as you type. Once you are done, submit the form.
The "All rights" fieldEdit
The "All rights" field is a convenience field. It doesn't add/remove every right in the permissions system, but rather every right that can be seen on the UserProtect page. So it's the equivalent of putting a user name in all of the fields individually. Of note, if the
$wgUserProtectRestrictionTypes global is later changed, that will affect any user with "All rights" accordingly.
- Download and place the file(s) in a directory called
- Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'UserProtect' );
- Run the update script which will automatically create the necessary database tables that this extension needs.
- Configure as required.
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
- Sets which user rights can be modified by the extension. Defaults to:
$wgUserProtectRestrictionTypes = [ 'edit' => true, 'move' => true, 'delete' => true ];
- For example, you can add to your "LocalSettings.php" file:
$wgUserProtectRestrictionTypes['delete'] = false; # Turn off the extension's ability to modify the delete right. $wgUserProtectRestrictionTypes['rollback'] = true; # Turn on the extension's ability to modify the rollback right.
- Also, this extension adds the
userprotectright which controls which users can use the UserProtect page to change the rights of other users (or their own). This right can be granted to individual users for particular pages by adding:
$wgUserProtectRestrictionTypes['userprotect'] = true; # Turn on the extension's ability to modify the userprotect right.
- The extension will probably work with any MediaWiki core or extension page-related right, but it has not been tested with all of them. It does not work with the "read" right.
- Allows users to use the "UserProtect" page action in order to add or remove user rights for this page. Defaults to:
$wgGroupPermissions['sysop']['userprotect'] = true;
- Extension:Semantic ACL – Allows adding per-page per-user rights with an in-page tag