mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-01 11:12:42 +01:00
4d362ddcee
Summary: Ref T6049, Add Phurl URL create capability Test Plan: - Change {nav Home > Applications > Phurl > Configure} to allow no one to create Phurl URLs - Attempt {nav Phurl > Shorten URL}. Should not be able to create a Phurl. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Maniphest Tasks: T6049 Differential Revision: https://secure.phabricator.com/D14510
71 lines
1.7 KiB
PHP
71 lines
1.7 KiB
PHP
<?php
|
|
|
|
final class PhabricatorPhurlApplication extends PhabricatorApplication {
|
|
|
|
public function getName() {
|
|
return pht('Phurl');
|
|
}
|
|
|
|
public function getShortDescription() {
|
|
return pht('URL Shortener');
|
|
}
|
|
|
|
public function getFlavorText() {
|
|
return pht('Shorten your favorite URL.');
|
|
}
|
|
|
|
public function getBaseURI() {
|
|
return '/phurl/';
|
|
}
|
|
|
|
public function getFontIcon() {
|
|
return 'fa-compress';
|
|
}
|
|
|
|
public function isPrototype() {
|
|
return true;
|
|
}
|
|
|
|
public function getRemarkupRules() {
|
|
return array(
|
|
new PhabricatorPhurlRemarkupRule(),
|
|
new PhabricatorPhurlLinkRemarkupRule(),
|
|
);
|
|
}
|
|
|
|
public function getRoutes() {
|
|
return array(
|
|
'/U(?P<id>[1-9]\d*)' => 'PhabricatorPhurlURLViewController',
|
|
'/u/(?P<id>[1-9]\d*)' => 'PhabricatorPhurlURLAccessController',
|
|
'/u/(?P<alias>[^/]+)' => 'PhabricatorPhurlURLAccessController',
|
|
'/phurl/' => array(
|
|
'(?:query/(?P<queryKey>[^/]+)/)?'
|
|
=> 'PhabricatorPhurlURLListController',
|
|
'url/' => array(
|
|
'create/'
|
|
=> 'PhabricatorPhurlURLEditController',
|
|
'edit/(?P<id>[1-9]\d*)/'
|
|
=> 'PhabricatorPhurlURLEditController',
|
|
'comment/(?P<id>[1-9]\d*)/'
|
|
=> 'PhabricatorPhurlURLCommentController',
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
public function getShortRoutes() {
|
|
return array(
|
|
'/u/(?P<append>[^/]+)' => 'PhabricatorPhurlShortURLController',
|
|
'.*' => 'PhabricatorPhurlShortURLDefaultController',
|
|
);
|
|
}
|
|
|
|
protected function getCustomCapabilities() {
|
|
return array(
|
|
PhabricatorPhurlURLCreateCapability::CAPABILITY => array(
|
|
'default' => PhabricatorPolicies::POLICY_USER,
|
|
),
|
|
);
|
|
}
|
|
|
|
}
|