Path: blob/master/src/applications/passphrase/policyrule/PassphraseCredentialAuthorPolicyRule.php
12256 views
<?php12final class PassphraseCredentialAuthorPolicyRule3extends PhabricatorPolicyRule {45public function getObjectPolicyKey() {6return 'passphrase.author';7}89public function getObjectPolicyName() {10return pht('Credential Author');11}1213public function getPolicyExplanation() {14return pht('The author of this credential can take this action.');15}1617public function getRuleDescription() {18return pht('credential author');19}2021public function canApplyToObject(PhabricatorPolicyInterface $object) {22return ($object instanceof PassphraseCredential);23}2425public function applyRule(26PhabricatorUser $viewer,27$value,28PhabricatorPolicyInterface $object) {2930$author_phid = $object->getAuthorPHID();31if (!$author_phid) {32return false;33}3435$viewer_phid = $viewer->getPHID();36if (!$viewer_phid) {37return false;38}3940return ($viewer_phid == $author_phid);41}4243public function getValueControlType() {44return self::CONTROL_TYPE_NONE;45}4647}484950