Differential D20648 Diff 49258 src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php
| Show All 32 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| $done_uri = $obj_handle->getURI(); | $done_uri = $obj_handle->getURI(); | ||||
| // We allow administrative removal of comments even if an object is locked, | // We allow administrative removal of comments even if an object is locked, | ||||
| // so you can lock a flamewar and then go clean it up. Locked threads may | // so you can lock a flamewar and then go clean it up. Locked threads may | ||||
| // not otherwise be edited, and non-administrators can not remove comments | // not otherwise be edited, and non-administrators can not remove comments | ||||
| // from locked threads. | // from locked threads. | ||||
| $object = $xaction->getObject(); | $object = $xaction->getObject(); | ||||
| $can_interact = PhabricatorPolicyFilter::hasCapability( | $can_interact = PhabricatorPolicyFilter::canInteract( | ||||
| $viewer, | $viewer, | ||||
| $object, | $object); | ||||
| PhabricatorPolicyCapability::CAN_INTERACT); | |||||
| if (!$can_interact && !$viewer->getIsAdmin()) { | if (!$can_interact && !$viewer->getIsAdmin()) { | ||||
| return $this->newDialog() | return $this->newDialog() | ||||
| ->setTitle(pht('Conversation Locked')) | ->setTitle(pht('Conversation Locked')) | ||||
| ->appendParagraph( | ->appendParagraph( | ||||
| pht( | pht( | ||||
| 'You can not remove this comment because the conversation is '. | 'You can not remove this comment because the conversation is '. | ||||
| 'locked.')) | 'locked.')) | ||||
| ->addCancelButton($done_uri); | ->addCancelButton($done_uri); | ||||
| ▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines | |||||