17

In MediaWiki, how can a user be given permission to edit only certain pages? This way, the administrator can create a page for the user and the user will be able to edit this particular page only.

Alan Haggai Alavi
  • 72,802
  • 19
  • 102
  • 127
  • 1
    You should check this out before you implement a page by page security option: http://www.mediawiki.org/wiki/Security_issues_with_authorization_extensions – Adrian Archer May 07 '10 at 13:33

9 Answers9

9

I think you're looking for SimpleSecurity.

  • 3
    "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." – Adrian Archer May 07 '10 at 13:32
  • 2
    Please see also this wiki Q&A forum in start up phase: http://area51.stackexchange.com/proposals/13716/wiki-edit – Reinstate Monica - Goodbye SE Jul 18 '10 at 17:35
3

I use extensions ImprovedAccessControlas well as PermissionACL.

Both work well for page by page, user by user, and namespace by namespace control.

Nina Cower
  • 73
  • 5
3

This is an old question, MediaWiki has evolved and there appeared the "Access_Control_List" extension. This nice page may help anyone who's still looking for the answer: https://www.mediawiki.org/wiki/Category:Page_specific_user_rights_extensions

Best regards!

/Ángel

Angel
  • 940
  • 1
  • 9
  • 21
2

I tried SimpleSecurity on wiki 1.17.0 and it works ok. But you are limited on 'Category' and 'Namespace' so you can't restrict some user to specific page.

The only solution I see is that you make categories and subcategories and add groups and restrict with Category and Groups. Add users to different groups and add to your LocalSettings.php:

$wgPageRestrictions['Category:Our_people']['edit'] = array('sysop', 'management');

I also looked other restriction extensions on http://www.mediawiki.org/wiki/Category:Page_specific_user_rights_extensions but a lot of them are not maintained anymore and some require that you edin core.... SimpleSecurity is very straighforward.

broadband
  • 3,266
  • 6
  • 43
  • 73
1

SimpleSecurity does not work anymore with 1.21.1...

What other methods are there to prevent reading on specific page or page of an category?

AccessControl, PreventPage and Lockdown are also not very good extensions.

arphex
  • 180
  • 12
1

Not directly, there's plenty of hacks/extensions that try to do the same thing.

See the Extensions page at the MediaWiki webpage:

MediaWiki Extensions

Aren
  • 54,668
  • 9
  • 68
  • 101
0

Refer the web link https://www.mediawiki.org/wiki/Manual:$wgRestrictionLevels

Create group and assign permission as per weblink shared.

sube singh
  • 125
  • 1
  • 7
  • sube singh, a link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it is there, then quote the most relevant part of the page you are linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted.](/help/deleted-answers) – Yunnosch May 03 '23 at 07:48
  • Thank you for providing the additional details ... in the other answer. You could have [edit]ed this one to do the same. May I recommend to now rely on the new one? To do that please delete this post. For that you can use the link "Delete" between this my comment and your answer post I am commenting on. – Yunnosch May 03 '23 at 14:11
0

Do the following changes in LocalSetting.php to create group and assign permission:

MediaWiki:Group-development(content: development)
MediaWiki:Group-development-member(content: development)
MediaWiki:Grouppage-development(content: Project:development)

$wgGroupPermissions['development']['edit'] = true;
$wgGroupPermissions['development']['createpage'] = true;
$wgGroupPermissions['development']['upload'] = true;
$wgGroupPermissions['development']['move'] = true;
$wgGroupPermissions['development']['protect'] = true;
  • add an additional protection level restricting edit/move/etc. to users with the "development" permission $wgRestrictionLevels[] = 'development-team';
  • give the "development" permission to users in the "development-team" and "development" groups $wgGroupPermissions['development']['development-team'] = true;
  • give the "development-team" permission to sysops (needed so sysops can apply this protection level to pages) $wgGroupPermissions['sysop']['development-team'] = true;

Reference:
https://www.mediawiki.org/wiki/Manual:$wgRestrictionLevels

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
sube singh
  • 125
  • 1
  • 7
  • I edited your formatting, to prevent it from being perceived as annoyingly "noisy" and the arrangement of the given info, for better readability. If I broke anything please accept my apology and feel free to undo and improve by [edit]ing with the help of https://stackoverflow.com/editing-help – Yunnosch May 03 '23 at 14:16
0

I have updated the following extension https://www.mediawiki.org/wiki/Extension:Restrict_access_by_category_and_group that provided page access control using user groups.

I extended the code to provide finer control to manage access to https://regional-training.org setup for student and trainer content.

The code is quite generic and user extensible.

Pages are not anonymously accessible unless they are marked [[Category:Public]] or whitelisted, and never accessible otherwise. Pages may also be marked [[Category:Private]] to exclude access unless you are a sysop or a member of special user categories.

There are other exclusive and inclusive Category controls that I included in my adaption of the extension.

To prevent robots trawling through the sidebar skin/Skins.php was modified to not present some navigation links.

See https://regional-training.org/rt/Category:Access_Control for the complete description of how it works, including code or code changes to the relevant files using Mediawiki version 1.38.2

The code can be made to work in earlier versions, however, be aware that the skins customisation can be different.