Page MenuHomePhabricator

API allows protection configuration that GUI does not allow, then fails to set them
Closed, ResolvedPublic

Description

Author: EN.WP.ST47

Description:
When passing the parameters:
action=protect
protections=edit=sysop|move=all
cascade=1
to the API, I receive a reply of:
protections => [

		{
		 'expiry' => 'infinite',
		 'edit' => 'sysop',
		},
		{
		 'expiry' => 'infinite',
		 'move' => '',
		}
		]

cascade => ""

That is, it's telling me that it set cascading, as I told it to and the same way it does when I set cascading properly, however cascading does not actually get set because it requires edit=sysop|move=sysop.


Version: 1.14.x
Severity: enhancement

Details

Reference
bz16613

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:25 PM
bzimport set Reference to bz16613.

(In reply to comment #0)

When passing the parameters:
action=protect
protections=edit=sysop|move=all
cascade=1
to the API, I receive a reply of:
protections => [

{
 'expiry' => 'infinite',
 'edit' => 'sysop',
},
{
 'expiry' => 'infinite',
 'move' => '',
}
]

cascade => ""

That is, it's telling me that it set cascading, as I told it to and the same
way it does when I set cascading properly, however cascading does not actually
get set because it requires edit=sysop|move=sysop.

That's kind of broken by design, because the fact that the *move* protection is too liberal shouldn't prevent cascading protection: only edit=sysop should be checked. But that's a different bug.

What isn't documented in the api.php help (it should be) but is at http://www.mediawiki.org/wiki/API:Edit_-_Protect is that &cascade is silently ignored if you're not allowed to cascade-protect. Of course, the output should reflect that; I hope to fix that tomorrow. I'll ask Brion about allowing cascade protection with move=all as well.

WTF, I thought I closed this one yesterday. Anyway...

(In reply to comment #1)

That is, it's telling me that it set cascading, as I told it to and the same
way it does when I set cascading properly, however cascading does not actually
get set because it requires edit=sysop|move=sysop.

Fixed in r44426.

That's kind of broken by design, because the fact that the *move* protection is
too liberal shouldn't prevent cascading protection: only edit=sysop should be
checked. But that's a different bug.

Fixed that in r44471, now let's hope Brion agrees with it :)

What isn't documented in the api.php help (it should be) but is at
http://www.mediawiki.org/wiki/API:Edit_-_Protect is that &cascade is silently
ignored if you're not allowed to cascade-protect.

Added that to the api.php docs too.