1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Made most of People inaccessible for passer-bys

Summary:
Depends on D5360; Refs T2770

See https://secure.phabricator.com/chatlog/channel/6/?at=54481 for discussion.

This will be a sad day, when I will repeatedly continue to hit a glass wall trying to get into `/people/` to browse the user list J4F at http://secure.phabricator.com/.

Test Plan:
verified that I could not access People as some passer-by.

Verified I could still access user profiles (at least I think I got the right controller for that).

Reviewers: epriestley, chad, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2770

Differential Revision: https://secure.phabricator.com/D5386
This commit is contained in:
Anh Nhan Nguyen 2013-03-19 13:48:50 -07:00 committed by epriestley
parent d21880530d
commit e3a9ddfc4f
7 changed files with 50 additions and 64 deletions

View file

@ -2218,7 +2218,7 @@ celerity_register_resource_map(array(
),
'javelin-event' =>
array(
'uri' => '/res/69d99d9f/rsrc/js/javelin/core/Event.js',
'uri' => '/res/73201bd3/rsrc/js/javelin/core/Event.js',
'type' => 'js',
'requires' =>
array(
@ -3860,7 +3860,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/f96657b8/diffusion.pkg.js',
'type' => 'js',
),
'cd1d650a' =>
'fe22443b' =>
array(
'name' => 'javelin.pkg.js',
'symbols' =>
@ -3885,7 +3885,7 @@ celerity_register_resource_map(array(
17 => 'javelin-typeahead-ondemand-source',
18 => 'javelin-tokenizer',
),
'uri' => '/res/pkg/cd1d650a/javelin.pkg.js',
'uri' => '/res/pkg/fe22443b/javelin.pkg.js',
'type' => 'js',
),
'c41b4907' =>
@ -3945,7 +3945,7 @@ celerity_register_resource_map(array(
'global-drag-and-drop-css' => '139bc58e',
'inline-comment-summary-css' => '8aaacd1b',
'javelin-aphlict' => '95ceba95',
'javelin-behavior' => 'cd1d650a',
'javelin-behavior' => 'fe22443b',
'javelin-behavior-aphlict-dropdown' => '95ceba95',
'javelin-behavior-aphlict-listen' => '95ceba95',
'javelin-behavior-aphront-basic-tokenizer' => '95ceba95',
@ -3996,24 +3996,24 @@ celerity_register_resource_map(array(
'javelin-behavior-repository-crossreference' => '322728f3',
'javelin-behavior-toggle-class' => '95ceba95',
'javelin-behavior-workflow' => '95ceba95',
'javelin-dom' => 'cd1d650a',
'javelin-event' => 'cd1d650a',
'javelin-install' => 'cd1d650a',
'javelin-json' => 'cd1d650a',
'javelin-mask' => 'cd1d650a',
'javelin-request' => 'cd1d650a',
'javelin-resource' => 'cd1d650a',
'javelin-stratcom' => 'cd1d650a',
'javelin-tokenizer' => 'cd1d650a',
'javelin-typeahead' => 'cd1d650a',
'javelin-typeahead-normalizer' => 'cd1d650a',
'javelin-typeahead-ondemand-source' => 'cd1d650a',
'javelin-typeahead-preloaded-source' => 'cd1d650a',
'javelin-typeahead-source' => 'cd1d650a',
'javelin-uri' => 'cd1d650a',
'javelin-util' => 'cd1d650a',
'javelin-vector' => 'cd1d650a',
'javelin-workflow' => 'cd1d650a',
'javelin-dom' => 'fe22443b',
'javelin-event' => 'fe22443b',
'javelin-install' => 'fe22443b',
'javelin-json' => 'fe22443b',
'javelin-mask' => 'fe22443b',
'javelin-request' => 'fe22443b',
'javelin-resource' => 'fe22443b',
'javelin-stratcom' => 'fe22443b',
'javelin-tokenizer' => 'fe22443b',
'javelin-typeahead' => 'fe22443b',
'javelin-typeahead-normalizer' => 'fe22443b',
'javelin-typeahead-ondemand-source' => 'fe22443b',
'javelin-typeahead-preloaded-source' => 'fe22443b',
'javelin-typeahead-source' => 'fe22443b',
'javelin-uri' => 'fe22443b',
'javelin-util' => 'fe22443b',
'javelin-vector' => 'fe22443b',
'javelin-workflow' => 'fe22443b',
'lightbox-attachment-css' => '139bc58e',
'maniphest-task-summary-css' => 'c41b4907',
'maniphest-transaction-detail-css' => 'c41b4907',

View file

@ -2,27 +2,25 @@
abstract class PhabricatorPeopleController extends PhabricatorController {
public function shouldRequireAdmin() {
return true;
}
public function buildSideNavView() {
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$is_admin = $this->getRequest()->getUser()->getIsAdmin();
if ($is_admin) {
$nav->addLabel(pht('User Administration'));
$nav->addFilter('edit', pht('Create New User'));
if (PhabricatorEnv::getEnvConfig('ldap.auth-enabled') === true) {
$nav->addFilter('ldap', pht('Import from LDAP'));
}
$nav->addLabel(pht('User Administration'));
$nav->addFilter('edit', pht('Create New User'));
if (PhabricatorEnv::getEnvConfig('ldap.auth-enabled') === true) {
$nav->addFilter('ldap', pht('Import from LDAP'));
}
$nav->addFilter('people',
pht('User Directory'),
$this->getApplicationURI());
if ($is_admin) {
$nav->addFilter('logs', pht('Activity Logs'));
}
$nav->addFilter('logs', pht('Activity Logs'));
return $nav;
}
@ -33,16 +31,12 @@ abstract class PhabricatorPeopleController extends PhabricatorController {
public function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
// I'm sure this copypasty is wrong.
$is_admin = $this->getRequest()->getUser()->getIsAdmin();
if ($is_admin) {
$crumbs->addAction(
id(new PhabricatorMenuItemView())
->setName(pht('Create New User'))
->setHref($this->getApplicationURI('edit'))
->setIcon('create'));
}
$crumbs->addAction(
id(new PhabricatorMenuItemView())
->setName(pht('Create New User'))
->setHref($this->getApplicationURI('edit'))
->setIcon('create'));
return $crumbs;
}

View file

@ -3,10 +3,6 @@
final class PhabricatorPeopleEditController
extends PhabricatorPeopleController {
public function shouldRequireAdmin() {
return true;
}
private $id;
private $view;

View file

@ -3,10 +3,6 @@
final class PhabricatorPeopleLdapController
extends PhabricatorPeopleController {
public function shouldRequireAdmin() {
return true;
}
private $view;
public function processRequest() {

View file

@ -46,18 +46,16 @@ final class PhabricatorPeopleListController
phabricator_time($user->getDateCreated(), $viewer)))
->addAttribute($email);
if ($is_admin) {
if ($user->getIsDisabled()) {
$item->addIcon('disable', pht('Disabled'));
}
if ($user->getIsDisabled()) {
$item->addIcon('disable', pht('Disabled'));
}
if ($user->getIsAdmin()) {
$item->addIcon('highlight', pht('Admin'));
}
if ($user->getIsAdmin()) {
$item->addIcon('highlight', pht('Admin'));
}
if ($user->getIsSystemAgent()) {
$item->addIcon('computer', pht('System Agent'));
}
if ($user->getIsSystemAgent()) {
$item->addIcon('computer', pht('System Agent'));
}
$list->addItem($item);

View file

@ -3,10 +3,6 @@
final class PhabricatorPeopleLogsController
extends PhabricatorPeopleController {
public function shouldRequireAdmin() {
return true;
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();

View file

@ -7,6 +7,12 @@ final class PhabricatorPeopleProfileController
private $page;
private $profileUser;
public function shouldRequireAdmin() {
// Default for people app is true
// We desire public access here
return false;
}
public function willProcessRequest(array $data) {
$this->username = idx($data, 'username');
$this->page = idx($data, 'page');