Page MenuHomePhabricator

D17696.id42560.diff
No OneTemporary

D17696.id42560.diff

diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php
--- a/src/applications/conpherence/controller/ConpherenceUpdateController.php
+++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php
@@ -20,7 +20,6 @@
$needed_capabilities[] = PhabricatorPolicyCapability::CAN_EDIT;
}
break;
- case ConpherenceUpdateActions::ADD_PERSON:
case ConpherenceUpdateActions::METADATA:
$needed_capabilities[] = PhabricatorPolicyCapability::CAN_EDIT;
break;
diff --git a/src/applications/conpherence/controller/ConpherenceViewController.php b/src/applications/conpherence/controller/ConpherenceViewController.php
--- a/src/applications/conpherence/controller/ConpherenceViewController.php
+++ b/src/applications/conpherence/controller/ConpherenceViewController.php
@@ -147,9 +147,6 @@
$user = $this->getRequest()->getUser();
$participating = $conpherence->getParticipantIfExists($user->getPHID());
- if (!$participating && $user->isLoggedIn()) {
- return null;
- }
$draft = PhabricatorDraft::newFromUserAndKey(
$user,
$conpherence->getPHID());
diff --git a/src/applications/conpherence/editor/ConpherenceEditor.php b/src/applications/conpherence/editor/ConpherenceEditor.php
--- a/src/applications/conpherence/editor/ConpherenceEditor.php
+++ b/src/applications/conpherence/editor/ConpherenceEditor.php
@@ -343,11 +343,30 @@
$actor_phid = $this->requireActor()->getPHID();
- // You need CAN_EDIT to change participants other than yourself.
- PhabricatorPolicyFilter::requireCapability(
- $this->requireActor(),
- $object,
- PhabricatorPolicyCapability::CAN_EDIT);
+ $is_join = (($add === array($actor_phid)) && !$rem);
+ $is_leave = (($rem === array($actor_phid)) && !$add);
+
+ if ($is_join) {
+ // You need to be able to see a thread to join it
+ PhabricatorPolicyFilter::requireCapability(
+ $this->requireActor(),
+ $object,
+ PhabricatorPolicyCapability::CAN_VIEW);
+ } else if ($is_leave) {
+ // You don't need any capabilities to leave a conpherence thread.
+ } else if ($add) {
+ // You need to be able to see a thread to add people to it.
+ PhabricatorPolicyFilter::requireCapability(
+ $this->requireActor(),
+ $object,
+ PhabricatorPolicyCapability::CAN_VIEW);
+ } else if ($rem) {
+ // You need CAN_EDIT to remove participants other than yourself.
+ PhabricatorPolicyFilter::requireCapability(
+ $this->requireActor(),
+ $object,
+ PhabricatorPolicyCapability::CAN_EDIT);
+ }
break;
case ConpherenceThreadTitleTransaction::TRANSACTIONTYPE:

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 27, 2:39 AM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7384891
Default Alt Text
D17696.id42560.diff (2 KB)

Event Timeline