Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/storage/PhabricatorUser.php
| Show First 20 Lines • Show All 1,234 Lines • ▼ Show 20 Lines | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
| public function getPolicy($capability) { | public function getPolicy($capability) { | ||||
| switch ($capability) { | switch ($capability) { | ||||
| case PhabricatorPolicyCapability::CAN_VIEW: | case PhabricatorPolicyCapability::CAN_VIEW: | ||||
| return PhabricatorPolicies::POLICY_PUBLIC; | return PhabricatorPolicies::POLICY_PUBLIC; | ||||
| case PhabricatorPolicyCapability::CAN_EDIT: | case PhabricatorPolicyCapability::CAN_EDIT: | ||||
| if ($this->getIsSystemAgent() || $this->getIsMailingList()) { | if ($this->getIsSystemAgent() || $this->getIsMailingList()) { | ||||
| return PhabricatorPolicies::POLICY_ADMIN; | return PhabricatorPolicies::POLICY_ADMIN; | ||||
| } else { | } else { | ||||
| return PhabricatorPolicies::POLICY_NOONE; | return PhabricatorPolicies::POLICY_ADMIN; | ||||
amckinley: This is obviously wrong, but it makes everything else work. | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | ||||
| return $this->getPHID() && ($viewer->getPHID() === $this->getPHID()); | return $this->getPHID() && ($viewer->getPHID() === $this->getPHID()); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 442 Lines • Show Last 20 Lines | |||||
This is obviously wrong, but it makes everything else work.