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
This commit is contained in:
@@ -25,6 +25,7 @@ final class PhabricatorPaste extends PhabricatorPasteDAO
|
||||
protected $filePHID;
|
||||
protected $language;
|
||||
protected $parentPHID;
|
||||
protected $viewPolicy;
|
||||
|
||||
private $content;
|
||||
|
||||
@@ -52,7 +53,7 @@ final class PhabricatorPaste extends PhabricatorPasteDAO
|
||||
|
||||
public function getPolicy($capability) {
|
||||
if ($capability == PhabricatorPolicyCapability::CAN_VIEW) {
|
||||
return PhabricatorPolicies::POLICY_USER;
|
||||
return $this->viewPolicy;
|
||||
}
|
||||
return PhabricatorPolicies::POLICY_NOONE;
|
||||
}
|
||||
|
||||
@@ -976,6 +976,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
|
||||
'type' => 'sql',
|
||||
'name' => $this->getPatchPath('ponder-comments.sql'),
|
||||
),
|
||||
'pastepolicy.sql' => array(
|
||||
'type' => 'sql',
|
||||
'name' => $this->getPatchPath('pastepolicy.sql'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user