Last modified: 2008-12-11 21:43:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T18613, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16613 - API allows protection configuration that GUI does not allow, then fails to set them
API allows protection configuration that GUI does not allow, then fails to se...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.14.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-10 21:46 UTC by Dan Collins
Modified: 2008-12-11 21:43 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Dan Collins 2008-12-10 21:46:06 UTC
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.
Comment 1 Roan Kattouw 2008-12-10 22:15:20 UTC
(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.
Comment 2 Roan Kattouw 2008-12-11 21:43:15 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links