1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 10:12:41 +01:00

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
This commit is contained in:
epriestley 2013-10-01 08:45:18 -07:00
parent 472be5e26e
commit 98bf001a58
3 changed files with 10 additions and 0 deletions

View file

@ -0,0 +1,5 @@
ALTER TABLE {$NAMESPACE}_file.file
ADD viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin;
UPDATE {$NAMESPACE}_file.file
SET viewPolicy = 'users' WHERE viewPolicy = '';

View file

@ -30,6 +30,7 @@ final class PhabricatorFile extends PhabricatorFileDAO
protected $ttl;
protected $isExplicitUpload = 1;
protected $viewPolicy = PhabricatorPolicies::POLICY_USER;
private $objects = self::ATTACHABLE;
private $objectPHIDs = self::ATTACHABLE;

View file

@ -1648,6 +1648,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
'type' => 'sql',
'name' => $this->getPatchPath('20130927.audiomacro.sql'),
),
'20130929.filepolicy.sql' => array(
'type' => 'sql',
'name' => $this->getPatchPath('20130929.filepolicy.sql'),
),
);
}
}