From db898834479061f3de672d89cc8fd2f0c6a366c2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 30 Dec 2013 16:48:36 -0800 Subject: [PATCH] Always include the current user as a selectable policy Summary: Ref T4136. After Passphrase, user policies work correctly in this dropdown. Providing this option improves consistency and makes it easier to create, e.g., a private repository (where "no one" does not include the viewer, because they don't own the resulting object). Test Plan: Set an object's policy to my user policy. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T4136 Differential Revision: https://secure.phabricator.com/D7858 --- src/applications/policy/query/PhabricatorPolicyQuery.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/applications/policy/query/PhabricatorPolicyQuery.php b/src/applications/policy/query/PhabricatorPolicyQuery.php index 246741786d..37c38a5d6b 100644 --- a/src/applications/policy/query/PhabricatorPolicyQuery.php +++ b/src/applications/policy/query/PhabricatorPolicyQuery.php @@ -190,6 +190,11 @@ final class PhabricatorPolicyQuery foreach ($projects as $project) { $phids[] = $project->getPHID(); } + + // Include the "current viewer" policy. This improves consistency, but + // is also useful for creating private instances of normally-shared object + // types, like repositories. + $phids[] = $viewer->getPHID(); } $capabilities = $this->object->getCapabilities();