@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add paste policy storage

Summary: Add storage to Pastes for view policies.

Test Plan: Set policies on pastes, see next diff.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3474

+11 -1
+5
resources/sql/patches/pastepolicy.sql
··· 1 + ALTER TABLE `{$NAMESPACE}_pastebin`.`pastebin_paste` 2 + ADD `viewPolicy` varchar(64) COLLATE utf8_bin; 3 + 4 + UPDATE `{$NAMESPACE}_pastebin`.`pastebin_paste` SET viewPolicy = 'users' 5 + WHERE viewPolicy IS NULL;
+2 -1
src/applications/paste/storage/PhabricatorPaste.php
··· 25 25 protected $filePHID; 26 26 protected $language; 27 27 protected $parentPHID; 28 + protected $viewPolicy; 28 29 29 30 private $content; 30 31 ··· 52 53 53 54 public function getPolicy($capability) { 54 55 if ($capability == PhabricatorPolicyCapability::CAN_VIEW) { 55 - return PhabricatorPolicies::POLICY_USER; 56 + return $this->viewPolicy; 56 57 } 57 58 return PhabricatorPolicies::POLICY_NOONE; 58 59 }
+4
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 976 976 'type' => 'sql', 977 977 'name' => $this->getPatchPath('ponder-comments.sql'), 978 978 ), 979 + 'pastepolicy.sql' => array( 980 + 'type' => 'sql', 981 + 'name' => $this->getPatchPath('pastepolicy.sql'), 982 + ), 979 983 ); 980 984 } 981 985