Jump to content

Topic on Extension talk:CategoryLockdown

Distinction between view and edit

4
Summary by Sophivorus

Use the following syntax:

$wgCategoryLockdown['Sales']['read'] = ['vendor','manager'];
$wgCategoryLockdown['Sales']['edit'] = 'vendor';
SharonFVR (talkcontribs)

Hi Sophivorus,


Thank you so much for the last improvement, it works great! Your extension is extremely useful for my wiki.

I'm looking to be able to distinguish, in a category, the possibility to view pages, and the possibility to edit them.

For instance, I'd like to be able to write something that says that, in the Maintenance category, the groups 'sysop' and 'developer' are able to view and edit pages; but the 'technician' group is only able to view them.


I don't know the proper syntax at all, but something like:


$wgCategoryLockdown = [

'Maintenance' => [ view : 'sysop', 'developer', 'technician' ],

[ edit : 'sysop', 'developer' ]

];


I'm no dev at all, do you reckon it's something you could add to your extension?

If you could, that would be awesome.

Thanks!

Sophivorus (talkcontribs)

Done! Please download the latest version (2.0), try it out and let me know of any bugs or issues! I also generalized the functionality so that you can restrict any permission, not just 'read' and 'edit'. See the updated documentation for the new syntax!

SharonFVR (talkcontribs)

Hi Sophivorus!


Thank you very much for your quick answer and improvement of the extension! I installed the last version of it.


It seems like I found an issue though. It seems that, now, the access restriction only works on the very own page of the category, but not on the pages that are part of this category. I don't think this was an issue before.


To clarify, if I write :


$wgCategoryLockdown['Sales and orders']['read'] = 'vendor';

$wgCategoryLockdown['Sales and orders']['edit'] = 'vendor';


the users that are not part of the 'vendor' group can't read and edit the page "Category:Sales and orders". But they can read and edit all the pages that are contained in the category Sales and orders, which is indesirable.

Do you reckon you could look into it?


Thank you!

EDIT : By testing it a little bit more, I noticed something : the issue only happens when the name of the category contains a space! If there is a space in the category name, the pages that are in this category are not taken into account by the access restrictions.

Sophivorus (talkcontribs)

Hi! Thanks to your detailed bug report, I was able to quickly identify and fix the issue. Please download the latest version (2.1) and let me know of any more issues. Thanks again!