Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/storage/PhabricatorUser.php
Show First 20 Lines • Show All 745 Lines • ▼ Show 20 Lines | public static function loadOneWithEmailAddress($address) { | ||||
if (!$email) { | if (!$email) { | ||||
return null; | return null; | ||||
} | } | ||||
return id(new PhabricatorUser())->loadOneWhere( | return id(new PhabricatorUser())->loadOneWhere( | ||||
'phid = %s', | 'phid = %s', | ||||
$email->getUserPHID()); | $email->getUserPHID()); | ||||
} | } | ||||
public function getDefaultSpacePHID() { | |||||
// TODO: We might let the user switch which space they're "in" later on; | |||||
// for now just use the global space if one exists. | |||||
$spaces = PhabricatorSpacesNamespaceQuery::getViewerSpaces($this); | |||||
foreach ($spaces as $space) { | |||||
if ($space->getIsDefaultNamespace()) { | |||||
return $space->getPHID(); | |||||
} | |||||
} | |||||
return null; | |||||
} | |||||
/** | /** | ||||
* Grant a user a source of authority, to let them bypass policy checks they | * Grant a user a source of authority, to let them bypass policy checks they | ||||
* could not otherwise. | * could not otherwise. | ||||
*/ | */ | ||||
public function grantAuthority($authority) { | public function grantAuthority($authority) { | ||||
$this->authorities[] = $authority; | $this->authorities[] = $authority; | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 441 Lines • Show Last 20 Lines |