From 1d9bf6f82b30817ed4fc7300d6f1469ea4770e05 Mon Sep 17 00:00:00 2001 From: James Rhodes Date: Thu, 12 Dec 2013 11:19:03 +1100 Subject: [PATCH] Fix Phortune so it allows users to create their accounts implicitly Summary: This is a small fix for Phortune so that policies don't prevent the user accounts from being implicitly created when they first visit Phortune. Test Plan: Visited Phortune and it worked. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley CC: Korvin, epriestley, aran Differential Revision: https://secure.phabricator.com/D7758 --- src/applications/phortune/storage/PhortuneAccount.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/applications/phortune/storage/PhortuneAccount.php b/src/applications/phortune/storage/PhortuneAccount.php index 6fbb752d13..8eff081370 100644 --- a/src/applications/phortune/storage/PhortuneAccount.php +++ b/src/applications/phortune/storage/PhortuneAccount.php @@ -46,7 +46,12 @@ final class PhortuneAccount extends PhortuneDAO } public function getPolicy($capability) { - return PhabricatorPolicies::POLICY_NOONE; + if ($this->getPHID() === null) { + // Allow a user to create an account for themselves. + return PhabricatorPolicies::POLICY_USER; + } else { + return PhabricatorPolicies::POLICY_NOONE; + } } public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {