Page MenuHomePhabricator

SubmissionHandler should expose real error messages, rather than coercing everything to "user is blocked"
Closed, ResolvedPublic


From T118567#1809438:

SubmissionHandler::handleSubmit() contains the following code:

// Check mediawiki core permissions for title protection, blocked
// status, etc.
if ( !$workflow->userCan( 'edit', $context->getUser() ) ) {
	reset( $interestedBlocks )->addError( 'block', wfMessage( 'blockedtitle' ) );
	return array();

This means that if there was any sort of error whatsoever, the reported error will be "user is blocked" even though the actual error might be something very different.

In MW core, Title::userCan() is really just a wrapper for Title::getUserPermissionsErrors(), so we should be able to surface the real error.


Related Gerrit Patches:
mediawiki/extensions/Flow : wmf/1.27.0-wmf.7Surface permission errors
mediawiki/extensions/Flow : masterSurface permission errors

Event Timeline

Catrope created this task.Nov 17 2015, 6:57 PM
Catrope assigned this task to SBisson.
Catrope raised the priority of this task from to High.
Catrope updated the task description. (Show Details)
Catrope added subscribers: Antigng, Trizek-WMF, Cosine02 and 5 others.

Change 253752 had a related patch set uploaded (by Sbisson):
Surface permission errors

Change 253752 merged by jenkins-bot:
Surface permission errors

Change 254074 had a related patch set uploaded (by Catrope):
Surface permission errors

Change 254074 merged by jenkins-bot:
Surface permission errors

At some point, it'd be great to review all error messages so they provide unambiguous feedback to users.

Catrope closed this task as Resolved.Nov 22 2015, 10:08 PM
Liuxinyu970226 removed a subscriber: Liuxinyu970226.