Last modified: 2006-07-04 08:11:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T8097, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 6097 - Patch to allow edits to be restricted to logged-in users with per-page exceptions to allow anonymous editing
Patch to allow edits to be restricted to logged-in users with per-page except...
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
1.7.x
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-26 16:42 UTC by netocrat
Modified: 2006-07-04 08:11 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Also apply EditPage.php.patch; both are against 1.6.5 but currently patch OK against svn code (2.37 KB, patch)
2006-05-26 16:44 UTC, netocrat
Details
Also apply Title.php.patch; both are against 1.6.5 but currently patch OK against svn code (2.32 KB, patch)
2006-05-26 16:44 UTC, netocrat
Details

Description netocrat 2006-05-26 16:42:27 UTC
When using MediaWiki as a solution for a non-Wikipedia site, it's sometimes
useful to configure it so that by default pages are not editable except by
logged-in users.  Then there are often pages that it would be handy to make an
exception for so that anonymous users can edit them.  There isn't a simple way
to achieve this exception in the default codebase that I've found, but by using
the new(ish) ProtectionForm and Title::getRestrictions() functionality, it's
possible to achieve this with small patches to EditPage.php and Title.php.

I'll attach the patches; there are a couple of other additions that also need to
be applied:
* add these lines to LocalSettings.php (be careful that $wgGroupPermissions
isn't overwritten later in the file and that these lines occur after
DefaultSettings.php has been included):
array_splice($wgRestrictionLevels, 1, 0, '*');
$wgGroupPermissions['*']['edit'] = false;
* Edit MediaWiki:Protect-level-* to read:
Allow all including anons/not-logged-in

Now to set an individual page to be editable by anonymous users, log in as a
sysop and click the 'protect' tab and select 'Allow all including
anons/not-logged-in' (click 'Unlock move permissions' prior to this if anonymous
users should not also be given permission to move the page).  To revert the page
to edits-by-logged-in-users-only, again click the 'protect' tab and choose
'(default)'.

There might then be some confusion due to the tab reading 'protect' when already
only logged in users can edit the page, but it should be easy to explain what
the '(default)' state is, perhaps by editing MediaWiki:Protect-text.  The more
dangerous opposite of the tab reading 'unprotect' when in fact the page is not
at all restricted won't (shouldn't) occur due to this patch.

This provides a starting-point for finer-grained ACLs in MediaWiki - a
group-based default per-right that can be overridden per-page.

The patches were generated against 1.6.5; they apply without error to present
svn, and seem to function as expected against svn code.
Comment 1 netocrat 2006-05-26 16:44:15 UTC
Created attachment 1831 [details]
Also apply EditPage.php.patch; both are against 1.6.5 but currently patch OK against svn code
Comment 2 netocrat 2006-05-26 16:44:49 UTC
Created attachment 1832 [details]
Also apply Title.php.patch; both are against 1.6.5 but currently patch OK against svn code
Comment 3 Rob Church 2006-07-04 08:11:02 UTC
Feel free to write hacks/patches to meet your own needs.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links