@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 `viewPolicy` and `attachedToObjectPHID` to PhabricatorFile

Summary:
Ref T603. Principally, I want to implement the rule "when you upload a file to an object, users must be able to see the object in order to see the file", since I think this is strongly in line with user expectation. For example, if you attach a file to a Conpherence, it should only be visible to members of that thread.

This adds storage for policies, but doesn't do anything interesting with it yet.

Test Plan: Ran `bin/storage upgrade`.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

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

+10
+5
resources/sql/patches/20130929.filepolicy.sql
··· 1 + ALTER TABLE {$NAMESPACE}_file.file 2 + ADD viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin; 3 + 4 + UPDATE {$NAMESPACE}_file.file 5 + SET viewPolicy = 'users' WHERE viewPolicy = '';
+1
src/applications/files/storage/PhabricatorFile.php
··· 30 30 31 31 protected $ttl; 32 32 protected $isExplicitUpload = 1; 33 + protected $viewPolicy = PhabricatorPolicies::POLICY_USER; 33 34 34 35 private $objects = self::ATTACHABLE; 35 36 private $objectPHIDs = self::ATTACHABLE;
+4
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 1648 1648 'type' => 'sql', 1649 1649 'name' => $this->getPatchPath('20130927.audiomacro.sql'), 1650 1650 ), 1651 + '20130929.filepolicy.sql' => array( 1652 + 'type' => 'sql', 1653 + 'name' => $this->getPatchPath('20130929.filepolicy.sql'), 1654 + ), 1651 1655 ); 1652 1656 } 1653 1657 }