Extension talk:PageProtection/Sourcecode (Jonabbey)

Section Problems
One problem with this code as it appears here is that there is no protection against editing sections that are contained in a &lt;protect-edit&gt; region. Because such sections are visible, MediaWiki will show the edit section link, which will cause the protectedEdit function to be called on the text within that section, which bypasses the &lt;protect-edit&gt; that surround such sections.

The protectedEdit function needs to be able to determine whether the requested section is contained in the bounds of a &lt;protect-edit&gt; section, or we need to be able to inhibit the edit section action from being available for such sections.

It's not clear that we could do either reasonably, or if we did, how best to do it.

I need to investigate more into the MediaWiki structure.

Jonabbey 21:15, 17 May 2006 (UTC)

Section Solutions
Okay, the version currently up makes it so that &lt;protect-edit&gt; anywhere on the page causes the entire page to be restricted-edit. Editing a section directly no longer bypasses protection.

Unfortunately, this makes it so that you can't have certain sections of a page non-editable with other sections editable. That would require a function that could identify what sections were in a &lt;protect-edit&gt; section and which ones were not, which would take a bit of doing.. especially because the &lt;protect-edit&gt; sections could partially overlap one or more sections.

Jonabbey 22:58, 17 May 2006 (UTC)

Bottom Line
Really, this means that the only use of &lt;protect-edit&gt; is to provide a more fine-grained page protection in the Wiki, as you can allow a designated user or group to edit a page, rather than just the sysop/no sysop choice of the built in page protect function that sysops can use.

It may be better just not to try and use this &lt;protect-edit&gt; modified version of Page Protection, as it removes the ability to have a simple edit/view &lt;protect&gt; tag around a subset of page without interfering with editing of the rest of the page.

On the other hand, I'm not convinced that the original code really does support &lt;protect&gt; around part of a page in a meaningful way, as I believe it is always possible to craft a direct section URL to gain editing access, bypassing the &lt;protect&gt;.

Jonabbey 23:30, 17 May 2006 (UTC)