diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 25e303fa8d..d59b108c37 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1625,7 +1625,6 @@ phutil_register_library_map(array( 'PhabricatorBadgesCreateCapability' => 'applications/badges/capability/PhabricatorBadgesCreateCapability.php', 'PhabricatorBadgesDAO' => 'applications/badges/storage/PhabricatorBadgesDAO.php', 'PhabricatorBadgesDefaultEditCapability' => 'applications/badges/capability/PhabricatorBadgesDefaultEditCapability.php', - 'PhabricatorBadgesDefaultViewCapability' => 'applications/badges/capability/PhabricatorBadgesDefaultViewCapability.php', 'PhabricatorBadgesEditController' => 'applications/badges/controller/PhabricatorBadgesEditController.php', 'PhabricatorBadgesEditIconController' => 'applications/badges/controller/PhabricatorBadgesEditIconController.php', 'PhabricatorBadgesEditRecipientsController' => 'applications/badges/controller/PhabricatorBadgesEditRecipientsController.php', @@ -5380,7 +5379,6 @@ phutil_register_library_map(array( 'PhabricatorBadgesCreateCapability' => 'PhabricatorPolicyCapability', 'PhabricatorBadgesDAO' => 'PhabricatorLiskDAO', 'PhabricatorBadgesDefaultEditCapability' => 'PhabricatorPolicyCapability', - 'PhabricatorBadgesDefaultViewCapability' => 'PhabricatorPolicyCapability', 'PhabricatorBadgesEditController' => 'PhabricatorBadgesController', 'PhabricatorBadgesEditIconController' => 'PhabricatorBadgesController', 'PhabricatorBadgesEditRecipientsController' => 'PhabricatorBadgesController', diff --git a/src/applications/badges/application/PhabricatorBadgesApplication.php b/src/applications/badges/application/PhabricatorBadgesApplication.php index 206c11abef..24bfe87818 100644 --- a/src/applications/badges/application/PhabricatorBadgesApplication.php +++ b/src/applications/badges/application/PhabricatorBadgesApplication.php @@ -71,10 +71,6 @@ final class PhabricatorBadgesApplication extends PhabricatorApplication { 'caption' => pht('Default edit policy for badges.'), 'template' => PhabricatorBadgesPHIDType::TYPECONST, ), - PhabricatorBadgesDefaultViewCapability::CAPABILITY => array( - 'caption' => pht('Default view policy for badges.'), - 'template' => PhabricatorBadgesPHIDType::TYPECONST, - ), ); } diff --git a/src/applications/badges/capability/PhabricatorBadgesDefaultViewCapability.php b/src/applications/badges/capability/PhabricatorBadgesDefaultViewCapability.php deleted file mode 100644 index de1523c341..0000000000 --- a/src/applications/badges/capability/PhabricatorBadgesDefaultViewCapability.php +++ /dev/null @@ -1,16 +0,0 @@ -getStatus(); $v_edit = $badge->getEditPolicy(); - $v_view = $badge->getViewPolicy(); $validation_exception = null; if ($request->isFormPost()) { @@ -70,7 +69,6 @@ final class PhabricatorBadgesEditController $type_qual = PhabricatorBadgesTransaction::TYPE_QUALITY; $type_stat = PhabricatorBadgesTransaction::TYPE_STATUS; - $type_view = PhabricatorTransactions::TYPE_VIEW_POLICY; $type_edit = PhabricatorTransactions::TYPE_EDIT_POLICY; $xactions = array(); @@ -99,10 +97,6 @@ final class PhabricatorBadgesEditController ->setTransactionType($type_stat) ->setNewValue($v_stat); - $xactions[] = id(new PhabricatorBadgesTransaction()) - ->setTransactionType($type_view) - ->setNewValue($v_view); - $xactions[] = id(new PhabricatorBadgesTransaction()) ->setTransactionType($type_edit) ->setNewValue($v_edit); @@ -175,13 +169,6 @@ final class PhabricatorBadgesEditController ->setName('description') ->setLabel(pht('Description')) ->setValue($v_desc)) - ->appendChild( - id(new AphrontFormPolicyControl()) - ->setName('viewPolicy') - ->setPolicyObject($badge) - ->setCapability(PhabricatorPolicyCapability::CAN_VIEW) - ->setValue($v_view) - ->setPolicies($policies)) ->appendChild( id(new AphrontFormPolicyControl()) ->setName('editPolicy') diff --git a/src/applications/badges/editor/PhabricatorBadgesEditor.php b/src/applications/badges/editor/PhabricatorBadgesEditor.php index 1cc6934b34..d060c6df7a 100644 --- a/src/applications/badges/editor/PhabricatorBadgesEditor.php +++ b/src/applications/badges/editor/PhabricatorBadgesEditor.php @@ -23,7 +23,6 @@ final class PhabricatorBadgesEditor $types[] = PhabricatorTransactions::TYPE_COMMENT; $types[] = PhabricatorTransactions::TYPE_EDGE; - $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY; return $types; diff --git a/src/applications/badges/storage/PhabricatorBadgesBadge.php b/src/applications/badges/storage/PhabricatorBadgesBadge.php index a8ad061325..b6f78566fc 100644 --- a/src/applications/badges/storage/PhabricatorBadgesBadge.php +++ b/src/applications/badges/storage/PhabricatorBadgesBadge.php @@ -63,8 +63,7 @@ final class PhabricatorBadgesBadge extends PhabricatorBadgesDAO ->withClasses(array('PhabricatorBadgesApplication')) ->executeOne(); - $view_policy = - $app->getPolicy(PhabricatorBadgesDefaultViewCapability::CAPABILITY); + $view_policy = PhabricatorPolicies::getMostOpenPolicy(); $edit_policy = $app->getPolicy(PhabricatorBadgesDefaultEditCapability::CAPABILITY); @@ -129,7 +128,7 @@ final class PhabricatorBadgesBadge extends PhabricatorBadgesDAO public function getPolicy($capability) { switch ($capability) { case PhabricatorPolicyCapability::CAN_VIEW: - return $this->getViewPolicy(); + return PhabricatorPolicies::getMostOpenPolicy(); case PhabricatorPolicyCapability::CAN_EDIT: return $this->getEditPolicy(); }