When an install has spaces but a user has no access, roadblock them

Summary:
Ref T8449. If a user doesn't have access to any spaces, most applications just don't work, and they fail in confusing ways.

Just lock users out of everything explicitly up front with a clear message instead of letting them stumble into a big broken mess.

Test Plan: Locked a user out of all spaces, saw error to that effect.

Reviewers: btrahan, eadler

Reviewed By: eadler

Subscribers: eadler, epriestley

Maniphest Tasks: T8449

Differential Revision: https://secure.phabricator.com/D13545
This commit is contained in:
epriestley
2015-07-03 13:03:33 -07:00
parent 92b73fed6b
commit bc22413fa7
3 changed files with 37 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
<?php
final class PhabricatorSpacesNoAccessController
extends PhabricatorSpacesController {
public function handleRequest(AphrontRequest $request) {
return $this->newDialog()
->setTitle(pht('No Access to Spaces'))
->appendParagraph(
pht(
'This install uses spaces to organize objects, but your account '.
'does not have access to any spaces.'))
->appendParagraph(
pht(
'Ask someone to add you to a Space so you can view and create '.
'objects.'))
->addCancelButton('/', pht('Drift Aimlessly'));
}
}