Make Maniphest list page react to viewer capabilities

Summary:
Ref T603. Basically:

  - Hide "Reports".
  - Hide "batch edit" and "export to excel".
  - Hide reprioritization controls.
  - I left the edit controls, they show a "login to continue" dialog when hit.
  - Allow tokenizer results to fill for public users.
  - Fix a bug where membership in projects was computed incorrectly in certain cases.
  - Add a unit test covering the project membership bug.

Test Plan: Viewed /maniphest/ when logged out, and while logged in.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7126
This commit is contained in:
epriestley
2013-09-25 13:45:04 -07:00
parent 800f6971bb
commit 1e2718d747
6 changed files with 62 additions and 4 deletions

View File

@@ -20,8 +20,11 @@ abstract class ManiphestController extends PhabricatorController {
->setViewer($user)
->addNavigationItems($nav->getMenu());
$nav->addLabel(pht('Reports'));
$nav->addFilter('report', pht('Reports'));
if ($user->isLoggedIn()) {
// For now, don't give logged-out users access to reports.
$nav->addLabel(pht('Reports'));
$nav->addFilter('report', pht('Reports'));
}
$nav->selectFilter(null);