1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-16 08:48:38 +01:00
phorge-phorge/src/applications/tokens/storage/PhabricatorToken.php
epriestley e7b590a1cf Generate expected schemata for Harbormaster
Summary:
Ref T1191. Nothing too notable here:

  - Allow a Lisk object to specify that there's no expectation that a table exists. We have one Harbormaster object and one Token object like this.
  - Removed BuildPlanTransactionComment because it's currently unused.

Test Plan:
  - Saw ~200 fewer warnings; just ~800 left.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D10583
2014-10-01 07:40:36 -07:00

49 lines
1.1 KiB
PHP

<?php
final class PhabricatorToken extends PhabricatorTokenDAO
implements PhabricatorPolicyInterface {
protected $phid;
protected $name;
protected $filePHID;
public function getConfiguration() {
return array(
self::CONFIG_AUX_PHID => true,
self::CONFIG_NO_TABLE => true,
) + parent::getConfiguration();
}
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,
);
}
public function getPolicy($capability) {
return PhabricatorPolicies::getMostOpenPolicy();
}
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
return false;
}
public function describeAutomaticCapability($capability) {
return null;
}
public function renderIcon() {
// TODO: Maybe move to a View class?
require_celerity_resource('sprite-tokens-css');
require_celerity_resource('tokens-css');
$sprite = substr($this->getPHID(), 10);
return id(new PHUIIconView())
->setSpriteSheet(PHUIIconView::SPRITE_TOKENS)
->setSpriteIcon($sprite);
}
}