Extension:EditOwn

From MediaWiki.org

Jump to: navigation, search

             

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
EditOwn

Release status: beta

Implementation  Hook
Description Unprivileged users can only edit pages they've created themselves
Author(s)  Roan Kattouw
Last Version  1.0 (October 22, 2007)
MediaWiki  1.11
License GPL
Download Download snapshot

Subversion [Help]
Browse source code

check usage (experimental)

EditOwn is an extension that prevents unprivileged users from editing pages they haven't created. Privileged users can of course edit every page.

Contents

[edit] Installation

Download the latest snapshot and extract it to your extensions directory. Then add the following to the bottom of LocalSettings.php:

require_once("$IP/extensions/EditOwn/EditOwn.php");
$wgGroupPermissions['sysop']['editall'] = true; // Only sysops can edit all pages

Then go to your wiki's Special:Version to verify the installation.

[edit] Permissions

You will probably want to allow some users to edit all pages. To set this up, two approaches are possible:

[edit] Using existing groups

Add any of the following lines to LocalSettings.php to allow existing groups of users to edit all pages:

$wgGroupPermissions['*']['editall'] = true; // Allow *everyone*, including anonymous users, to edit all pages. This makes this extension useless
$wgGroupPermissions['user']['editall'] = true; // Registered users can edit all pages. The usefulness of this setting is also doubtful
$wgGroupPermissions['autoconfirmed']['editall'] = true; // Only users older than $wgAutoConfirmAge can edit all pages
$wgGroupPermissions['sysop']['editall'] = true; // Only sysops can edit all pages. This is the recommended setup
$wgGroupPermissions['bureaucrat']['editall'] = true; // Only bureaucrats can edit all pages

If you have created any custom groups in LocalSettings.php, you can allow these groups to edit all pages by adding

$wgGroupPermissions['groupname']['editall'] = true;

to LocalSettings.php (replace 'groupname' with the name of your custom group).

NOTE: If a user is in multiple groups, they will be able to edit all pages even if that's allowed for only one of those groups. E.g.: if group A can't edit all pages but group B can, a user in both group A and B will be allowed to edit all pages.

[edit] Creating a new group

You can also create a separate group for users who can edit all pages. To do this, add the following line to LocalSettings.php:

$wgGroupPermissions['editall']['editall'] = true;

This creates a new group named 'editall'. Only users in that group can edit all pages. You can add users to the editall group using the Special:Userrights special page.

[edit] Excluding namespaces

You may want to disable EditOwn's functionality for certain namespaces. To do this, add the following line to LocalSettings.php, below the line added earlier (require_once("$IP/extensions/EditOwn/EditOwn.php");):

$wgEditOwnExcludedNamespaces = array(NS_TALK, NS_USER, NS_USER_TALK);

This will disable EditOwn for the Talk, User and User talk namespaces. A list of all namespace constants can be found here.

[edit] Restricting actions other than editing

You may want to use EditOwn's functionality to disable actions other than editing in a similar way, e.g. to allow users to only delete pages they've created themselves. This is done with:

$wgEditOwnActions[] = 'delete';

NOTE: Users who don't have the 'delete' right won't be able to delete anything, no matter how EditOwn is configured.

NOTE: The 'editall' right applies to these action as well, i.e. users with the 'editall' right will also be able to perform actions in $wgEditOwnActions regardless of who created the page in question (provided, of course, they have the right to perform that action in the first place).


[edit] Licensing and downloads

The extension is available under the GNU General Public License version 3 or later, and can be downloaded from Subversion, or accessed via the web-based viewer.

The software is provided as-is. Updates will be made where critical vulnerabilities are discovered.

[edit] Contact

EditOwn is currently maintained by Roan Kattouw. If you have any questions, complaints, feature requests, found a bug, or any other reason to contact the maintainer, please send your e-mails to roan.kattouw@gmail.nl and mention "EditOwn" in the subject.