Extension:CategoryLockdown
Template:Page security extension disclaimer
Lua error: callParserFunction: function "#translation" was not found.Lua error: callParserFunction: function "#translation" was not found. Extension:CategoryLockdown Release status: stable[[Category:stable extensions{{#translation:}}]] |
|
---|---|
Implementation | Lua error: callParserFunction: function "#translation" was not found. |
Description | Restrict permissions by category and group |
Author(s) | Sophivorustalk |
Latest version | Lua error: callParserFunction: function "#translation" was not found. (2021-12-13) |
MediaWiki | Lua error: callParserFunction: function "#translation" was not found. |
PHP | Lua error: callParserFunction: function "#translation" was not found. |
Database changes | No |
Composer | Lua error: callParserFunction: function "#translation" was not found. |
License | Lua error: callParserFunction: function "#translation" was not found. |
Download | [[Category:Extensions in Wikimedia version control{{#translation:}}]] |
Example | [1] |
Lua error: callParserFunction: function "#translation" was not found. |
|
Lua error: callParserFunction: function "#translation" was not found. |
|
Quarterly downloads | Lua error: callParserFunction: function "#translation" was not found. |
Public wikis using | Lua error: callParserFunction: function "#translation" was not found. |
Translate the Extension:CategoryLockdown extension if it is available at translatewiki.net | |
[[Category:All extensions{{#translation:}}]]Lua error: callParserFunction: function "#translation" was not found. Lua error: callParserFunction: function "#translation" was not found.
The CategoryLockdown extension allows admins to restrict permissions by category and group.
Installation
Usage
To restrict the 'read' permission of the Category:Maintenance and its pages to the 'sysop' group only (admins), add the following to your LocalSettings.php:
<syntaxhighlight lang="php"> $wgCategoryLockdown['Maintenance']['read'] = 'sysop'; </syntaxhighlight>Similarly, to restrict the 'edit' permission of the Category:Sales and its pages to the 'vendor' group:<syntaxhighlight lang="php"> $wgCategoryLockdown['Sales']['edit'] = 'vendor'; </syntaxhighlight>
To restrict editing to users in the 'vendor' OR 'manager' groups:
<syntaxhighlight lang="php"> $wgCategoryLockdown['Sales']['edit'] = [ 'vendor', 'manager' ]; </syntaxhighlight>
Note that pages in subcategories are not affected. If Category:Clients is a subcategory of Category:Sales, then pages within it won't be protected by the above setting. You'd need to add:
<syntaxhighlight lang="php"> $wgCategoryLockdown['Clients']['edit'] = [ 'vendor', 'manager' ]; </syntaxhighlight>
Also note that if a page is in the Category:Sales and the Category:Clients, then the following will restrict editing to users in the 'vendor' OR 'manager' groups:
<syntaxhighlight lang="php"> $wgCategoryLockdown['Sales']['edit'] = 'vendor', $wgCategoryLockdown['Clients']['edit'] = 'manager'; </syntaxhighlight>
Finally, note that:
- Rules don't apply to admins.
- You can use this syntax to restrict any permission (not just 'read' and 'edit'). However, if users are allowed to read and edit a page, then they can avoid other restrictions by re-categorizing the page.
- This extension only removes permissions, it doesn't grant them. If the general config of your wiki forbids editing to all users, then adding a rule that restricts editing to a certain group won't work. Instead, allow editing to all users and then use this extension to restrict editing to the desired group.
See also
- Extension:Lockdown - More sophisticated but cannot restrict access by category and group
- Extension:Restrict access by category and group - Similar idea but more complicated and unmaintained