From 874ae4b7ee57e86cee3b935a7c1143df2d262537 Mon Sep 17 00:00:00 2001 From: Marek Sapota Date: Tue, 1 Nov 2011 12:31:51 -0700 Subject: [PATCH] Allow anonymous access to conduit getdiff method. Summary: Allow anonymous access to conduit getdiff method, which is needed for anonymous `arc patch`. Test Plan: Running getdiff with an unauthenticated conduit should work. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: 1068 --- .../getdiff/ConduitAPI_differential_getdiff_Method.php | 4 ++++ .../conduit/method/differential/getdiff/__init__.php | 1 + 2 files changed, 5 insertions(+) diff --git a/src/applications/conduit/method/differential/getdiff/ConduitAPI_differential_getdiff_Method.php b/src/applications/conduit/method/differential/getdiff/ConduitAPI_differential_getdiff_Method.php index 2968079017..df9a28d00b 100644 --- a/src/applications/conduit/method/differential/getdiff/ConduitAPI_differential_getdiff_Method.php +++ b/src/applications/conduit/method/differential/getdiff/ConduitAPI_differential_getdiff_Method.php @@ -43,6 +43,10 @@ class ConduitAPI_differential_getdiff_Method extends ConduitAPIMethod { ); } + public function shouldRequireAuthentication() { + return !PhabricatorEnv::getEnvConfig('differential.anonymous-access'); + } + protected function execute(ConduitAPIRequest $request) { $diff = null; diff --git a/src/applications/conduit/method/differential/getdiff/__init__.php b/src/applications/conduit/method/differential/getdiff/__init__.php index 15399190d3..ee5f6cc825 100644 --- a/src/applications/conduit/method/differential/getdiff/__init__.php +++ b/src/applications/conduit/method/differential/getdiff/__init__.php @@ -10,6 +10,7 @@ phutil_require_module('phabricator', 'applications/conduit/method/base'); phutil_require_module('phabricator', 'applications/conduit/protocol/exception'); phutil_require_module('phabricator', 'applications/differential/storage/diff'); phutil_require_module('phabricator', 'applications/differential/storage/revision'); +phutil_require_module('phabricator', 'infrastructure/env'); phutil_require_module('phutil', 'utils');