Topic on Project:Support desk

How do I implement Role based user access on Mediawiki?

8
Garvjain82 (talkcontribs)

I am trying to setup a private wiki for my team. I have already achieved AD based authentication to login into the wiki using LDAPAuthentication extension. But now I want to implement some kind of role based access. To be more precise - 1. I have setup 5 different project pages 2. Now I want that only the people who are part of a particular project can access that page 3. Also any subsequent pages placed within this project page also need to follow the access restriction set for the project page by default

If any extension provides the facility out of the box, it would be good to know.

Lbillett (talkcontribs)

You might peruse (if you haven't) Category:User rights extensions for what you need. In my experience, none of them will give you exactly what you want without risking trouble down the road. There is a trend of un-maintained extensions in this flavor, perhaps due to how tricky it is to accomplish in the first place.

We currently use Extension:Lockdown to protect content that is considered secret (and there's not much of it). It's based on defining namespaces and associating each with groups allowed to see them. It's not perfect, but has a history of being maintained and gets the job done. We used Extension:SimpleSecurity for a couple years, but it went unstable after some upgrades. We cut it loose when newer features of MW were too useful to resist. You should check out Extension:Access Control List (a spinoff of HaloACL from SMW+ ). If it gets/maintains a strong following I'll probably be checking it out soon. It could be the tipping point for corporate mediawiki adoption.

Further, I'd strongly recommend examining what reasons you have for limiting access to users across the same mediawiki installation. Mediawiki works because it connects a community who all have the same interest/stake in the content and are empowers them to improve it. If the users are deprived this ability, you are left with a CMS that tracks history. If you really want to reliably separate who can see what, install a wiki for each group.

Garvjain82 (talkcontribs)

Lbillett - Thanks for the info. Actually i have explored some of the extensions you mentioned above. My immediate need now is How can I automatically assign custom namespaces to new pages created on Mediawiki? To elaborate on this - lets say I have created two namespaces - X and Y. Also 2 content pages - test1 and test2. I have mapped these under X and Y respectively. Now what I want is that every time a user creates a new page (on test1) it automatically gets mapped under namespace X and similarly for pages created under test2 to get mapped under namespace Y. Essentially I want to force pages to be assigned to namespaces of my choice. Is there a solution for this or an already available extension for this?

Lbillett (talkcontribs)

If I understand correctly, you almost want to force users to type in the fully qualified page name with namespace prefix "X:test1" or "Y:test2" etc. every time they create a page, but without them actually having to do this?

You should check out Extension:SemanticForms. It would allow you to make custom page creation forms that would accomplish the above easily. If you combine that with some user information extensions like Extension:WikiUserInfo you can preferentially display content (not in the security sense) to users based on their group.

Otherwise, you're talking about creating some page like Main:mypage then performing a move operation to X:mypage.

Ciencia Al Poder (talkcontribs)

You can use Extension:CreateBox so people don't have to manually type the namespace, you can simply fill the prefix= parameter with the namespace and pages will be created on them.

You can then put several createbox, one for every namespace.

182.71.223.2 (talkcontribs)

Ciencia - I wanted to use CreateBox but could not get the source or extension snapshot

Ciencia Al Poder (talkcontribs)

Whoops, the correct extension is Extension:InputBox, which is bundled in MediaWiki tarballs

182.71.223.2 (talkcontribs)

yeah I used that. Thanks. But its all turning into a one big hack :). Looking now for something out of the box now. Exploring other wikis too.

Reply to "How do I implement Role based user access on Mediawiki?"