mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-28 08:20:57 +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:
parent
472be5e26e
commit
98bf001a58
3 changed files with 10 additions and 0 deletions
5
resources/sql/patches/20130929.filepolicy.sql
Normal file
5
resources/sql/patches/20130929.filepolicy.sql
Normal 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 = '';
|
|
@ -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;
|
||||
|
|
|
@ -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'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue