diff --git a/roles/phabricator/files/RepositoryAuthorPolicyRule.php b/roles/phabricator/files/RepositoryAuthorPolicyRule.php index c579d45..a6106ed 100644 --- a/roles/phabricator/files/RepositoryAuthorPolicyRule.php +++ b/roles/phabricator/files/RepositoryAuthorPolicyRule.php @@ -1,66 +1,65 @@ getPHID(); if (!$viewer_phid) { return false; } // If the repository doesn't exist, we allow the user to create it $repo_phid = $object->getPHID(); if(!$repo_phid){ return true; } // Get all repositories the user has created $repo_transaction = id(new PhabricatorRepositoryTransactionQuery()) ->setViewer(PhabricatorUser::getOmnipotentUser()) ->withAuthorPHIDs(array($viewer_phid)) ->withTransactionTypes(array(PhabricatorTransactions::TYPE_CREATE)) ->execute(); // Check if the current repository has been created by the user if(!empty($repo_transaction)) { $repo_phids = mpull($repo_transaction, 'getObjectPHID'); if(in_array($repo_phid, $repo_phids, true) == true){ return true; } } return false; } public function getValueControlType() { return self::CONTROL_TYPE_NONE; } }