3 final class NuanceQueue
6 PhabricatorPolicyInterface
,
7 PhabricatorApplicationTransactionInterface
{
11 protected $viewPolicy;
12 protected $editPolicy;
14 protected function getConfiguration() {
16 self
::CONFIG_AUX_PHID
=> true,
17 self
::CONFIG_COLUMN_SCHEMA
=> array(
19 'mailKey' => 'bytes20',
21 ) + parent
::getConfiguration();
24 public function generatePHID() {
25 return PhabricatorPHID
::generateNewPHID(
26 NuanceQueuePHIDType
::TYPECONST
);
29 public static function initializeNewQueue() {
31 ->setViewPolicy(PhabricatorPolicies
::POLICY_USER
)
32 ->setEditPolicy(PhabricatorPolicies
::POLICY_USER
);
35 public function save() {
36 if (!$this->getMailKey()) {
37 $this->setMailKey(Filesystem
::readRandomCharacters(20));
39 return parent
::save();
42 public function getURI() {
43 return '/nuance/queue/view/'.$this->getID().'/';
46 public function getWorkURI() {
47 return '/nuance/queue/work/'.$this->getID().'/';
51 /* -( PhabricatorPolicyInterface )----------------------------------------- */
54 public function getCapabilities() {
56 PhabricatorPolicyCapability
::CAN_VIEW
,
57 PhabricatorPolicyCapability
::CAN_EDIT
,
61 public function getPolicy($capability) {
62 switch ($capability) {
63 case PhabricatorPolicyCapability
::CAN_VIEW
:
64 return $this->getViewPolicy();
65 case PhabricatorPolicyCapability
::CAN_EDIT
:
66 return $this->getEditPolicy();
70 public function hasAutomaticCapability($capability, PhabricatorUser
$viewer) {
75 /* -( PhabricatorApplicationTransactionInterface )------------------------- */
78 public function getApplicationTransactionEditor() {
79 return new NuanceQueueEditor();
82 public function getApplicationTransactionTemplate() {
83 return new NuanceQueueTransaction();