Page MenuHomePhabricator

D10412.id.diff
No OneTemporary

D10412.id.diff

diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php
--- a/src/applications/differential/controller/DifferentialRevisionViewController.php
+++ b/src/applications/differential/controller/DifferentialRevisionViewController.php
@@ -913,9 +913,7 @@
));
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
- $file->attachToObject(
- $this->getRequest()->getUser(),
- $revision->getPHID());
+ $file->attachToObject($revision->getPHID());
unset($unguarded);
return $file->getRedirectResponse();
diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
--- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
@@ -881,7 +881,6 @@
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
$file->attachToObject(
- $this->getRequest()->getUser(),
$this->getDiffusionRequest()->getRepository()->getPHID());
unset($unguarded);
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -1037,9 +1037,7 @@
));
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
- $file->attachToObject(
- $this->getRequest()->getUser(),
- $drequest->getRepository()->getPHID());
+ $file->attachToObject($drequest->getRepository()->getPHID());
unset($unguarded);
return $file->getRedirectResponse();
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -944,11 +944,10 @@
/**
* Write the policy edge between this file and some object.
*
- * @param PhabricatorUser Acting user.
* @param phid Object PHID to attach to.
* @return this
*/
- public function attachToObject(PhabricatorUser $actor, $phid) {
+ public function attachToObject($phid) {
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
id(new PhabricatorEdgeEditor())
diff --git a/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php b/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php
--- a/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php
+++ b/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php
@@ -60,7 +60,7 @@
// Attach the file to the object and test that the association opens a
// policy exception for the non-author viewer.
- $file->attachToObject($author, $object->getPHID());
+ $file->attachToObject($object->getPHID());
// Test the attached file's visibility.
$this->assertEqual(
diff --git a/src/applications/macro/editor/PhabricatorMacroEditor.php b/src/applications/macro/editor/PhabricatorMacroEditor.php
--- a/src/applications/macro/editor/PhabricatorMacroEditor.php
+++ b/src/applications/macro/editor/PhabricatorMacroEditor.php
@@ -111,7 +111,7 @@
$new_file = idx($files, $new);
if ($new_file) {
- $new_file->attachToObject($this->requireActor(), $object->getPHID());
+ $new_file->attachToObject($object->getPHID());
}
break;
}
diff --git a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
--- a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
+++ b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
@@ -83,7 +83,7 @@
$user->setProfileImagePHID(null);
} else {
$user->setProfileImagePHID($xformed->getPHID());
- $xformed->attachToObject($viewer, $user->getPHID());
+ $xformed->attachToObject($user->getPHID());
}
$user->save();
return id(new AphrontRedirectResponse())->setURI($profile_uri);
diff --git a/src/applications/phragment/controller/PhragmentPatchController.php b/src/applications/phragment/controller/PhragmentPatchController.php
--- a/src/applications/phragment/controller/PhragmentPatchController.php
+++ b/src/applications/phragment/controller/PhragmentPatchController.php
@@ -94,7 +94,7 @@
));
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
- $result->attachToObject($viewer, $version_b->getFragmentPHID());
+ $result->attachToObject($version_b->getFragmentPHID());
unset($unguarded);
return id(new AphrontRedirectResponse())
diff --git a/src/applications/phragment/controller/PhragmentZIPController.php b/src/applications/phragment/controller/PhragmentZIPController.php
--- a/src/applications/phragment/controller/PhragmentZIPController.php
+++ b/src/applications/phragment/controller/PhragmentZIPController.php
@@ -114,7 +114,7 @@
));
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
- $file->attachToObject($viewer, $fragment->getPHID());
+ $file->attachToObject($fragment->getPHID());
unset($unguarded);
$return = $fragment->getURI();
diff --git a/src/applications/phragment/storage/PhragmentFragment.php b/src/applications/phragment/storage/PhragmentFragment.php
--- a/src/applications/phragment/storage/PhragmentFragment.php
+++ b/src/applications/phragment/storage/PhragmentFragment.php
@@ -119,7 +119,7 @@
$this->save();
$this->saveTransaction();
- $file->attachToObject($viewer, $version->getPHID());
+ $file->attachToObject($version->getPHID());
}
/**

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 23, 9:26 AM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6730784
Default Alt Text
D10412.id.diff (5 KB)

Event Timeline