protected function getConfiguration() { $config = parent::getConfiguration(); $config[self::CONFIG_COLUMN_SCHEMA] = array('documentID' => 'id?', 'lineNumber' => 'uint32', 'lineLength' => 'uint32', 'fixedState' => 'text12?', 'hasReplies' => 'bool', 'replyToCommentPHID' => 'phid?') + $config[self::CONFIG_COLUMN_SCHEMA]; $config[self::CONFIG_KEY_SCHEMA] = array('key_draft' => array('columns' => array('authorPHID', 'documentID', 'transactionPHID'), 'unique' => true)) + $config[self::CONFIG_KEY_SCHEMA]; return $config; }
protected function getConfiguration() { $config = parent::getConfiguration(); $config[self::CONFIG_COLUMN_SCHEMA] = array('commitPHID' => 'phid?', 'pathID' => 'id?', 'isNewFile' => 'bool', 'lineNumber' => 'uint32', 'lineLength' => 'uint32', 'fixedState' => 'text12?', 'hasReplies' => 'bool', 'replyToCommentPHID' => 'phid?', 'legacyCommentID' => 'id?') + $config[self::CONFIG_COLUMN_SCHEMA]; $config[self::CONFIG_KEY_SCHEMA] = array('key_path' => array('columns' => array('pathID')), 'key_draft' => array('columns' => array('authorPHID', 'transactionPHID')), 'key_commit' => array('columns' => array('commitPHID')), 'key_legacy' => array('columns' => array('legacyCommentID'))) + $config[self::CONFIG_KEY_SCHEMA]; return $config; }
protected function getConfiguration() { $config = parent::getConfiguration(); $config[self::CONFIG_COLUMN_SCHEMA] = array('conpherencePHID' => 'phid?') + $config[self::CONFIG_COLUMN_SCHEMA]; $config[self::CONFIG_KEY_SCHEMA] = array('key_draft' => array('columns' => array('authorPHID', 'conpherencePHID', 'transactionPHID'), 'unique' => true)) + $config[self::CONFIG_KEY_SCHEMA]; return $config; }
protected function getConfiguration() { $config = parent::getConfiguration(); $config[self::CONFIG_COLUMN_SCHEMA] = array('imageID' => 'id?', 'x' => 'uint32?', 'y' => 'uint32?', 'width' => 'uint32?', 'height' => 'uint32?') + $config[self::CONFIG_COLUMN_SCHEMA]; $config[self::CONFIG_KEY_SCHEMA] = array('key_draft' => array('columns' => array('authorPHID', 'imageID', 'transactionPHID'), 'unique' => true)) + $config[self::CONFIG_KEY_SCHEMA]; return $config; }
/** * Validate that the edit is permissible, and the actor has permission to * perform it. */ private function validateEdit(PhabricatorApplicationTransaction $xaction, PhabricatorApplicationTransactionComment $comment) { if (!$xaction->getPHID()) { throw new Exception('Transaction must have a PHID before calling applyEdit()!'); } $type_comment = PhabricatorTransactions::TYPE_COMMENT; if ($xaction->getTransactionType() == $type_comment) { if ($comment->getPHID()) { throw new Exception('Transaction comment must not yet have a PHID!'); } } if (!$this->getContentSource()) { throw new Exception('Call setContentSource() before applyEdit()!'); } $actor = $this->requireActor(); PhabricatorPolicyFilter::requireCapability($actor, $xaction, PhabricatorPolicyCapability::CAN_VIEW); if ($comment->getIsRemoved() && $actor->getIsAdmin()) { // NOTE: Administrators can remove comments by any user, and don't need // to pass the edit check. } else { PhabricatorPolicyFilter::requireCapability($actor, $xaction, PhabricatorPolicyCapability::CAN_EDIT); } }
protected function getConfiguration() { $config = parent::getConfiguration(); $config[self::CONFIG_COLUMN_SCHEMA] = array('lineNumber' => 'uint32?', 'lineLength' => 'uint32?') + $config[self::CONFIG_COLUMN_SCHEMA]; return $config; }