Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F73154
D7351.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7351.diff
View Options
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -697,19 +697,27 @@
$object,
PhabricatorPolicyCapability::CAN_VIEW);
- // TODO: This should be "$object", not "$xaction", but probably breaks a
- // lot of stuff if fixed -- you don't need to be able to edit in order to
- // comment. Instead, transactions should specify the capabilities they
- // require.
+ foreach ($xactions as $xaction) {
+ $this->requireCapabilities($object, $xaction);
+ }
+ }
- /*
+ protected function requireCapabilities(
+ PhabricatorLiskDAO $object,
+ PhabricatorApplicationTransaction $xaction) {
- PhabricatorPolicyFilter::requireCapability(
- $actor,
- $xaction,
- PhabricatorPolicyCapability::CAN_EDIT);
+ switch ($xaction->getTransactionType()) {
+ case PhabricatorTransactions::TYPE_EDIT_POLICY:
+ // You must have the edit capability to alter the edit policy of an
+ // object. For other default transaction types, we don't enforce
+ // anything for the moment.
- */
+ PhabricatorPolicyFilter::requireCapability(
+ $this->requireActor(),
+ $object,
+ PhabricatorPolicyCapability::CAN_EDIT);
+ break;
+ }
}
private function buildMentionTransaction(
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/jf/fm/dsbc2jcw67qjt7vy
Default Alt Text
D7351.diff (1 KB)
Attached To
Mode
D7351: Clean up supplemental capabilitiy checks in transaction edits
Attached
Detach File
Event Timeline
Log In to Comment