Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / oauthserver / editor / PhabricatorOAuthServerEditEngine.php
blobad47552c19da811e4a43d756cabcc69cda983322
1 <?php
3 final class PhabricatorOAuthServerEditEngine
4 extends PhabricatorEditEngine {
6 const ENGINECONST = 'oauthserver.application';
8 public function isEngineConfigurable() {
9 return false;
12 public function getEngineName() {
13 return pht('OAuth Applications');
16 public function getSummaryHeader() {
17 return pht('Edit OAuth Applications');
20 public function getSummaryText() {
21 return pht('This engine manages OAuth client applications.');
24 public function getEngineApplicationClass() {
25 return 'PhabricatorOAuthServerApplication';
28 protected function newEditableObject() {
29 return PhabricatorOAuthServerClient::initializeNewClient(
30 $this->getViewer());
33 protected function newObjectQuery() {
34 return id(new PhabricatorOAuthServerClientQuery());
37 protected function getObjectCreateTitleText($object) {
38 return pht('Create OAuth Server');
41 protected function getObjectCreateButtonText($object) {
42 return pht('Create OAuth Server');
45 protected function getObjectEditTitleText($object) {
46 return pht('Edit OAuth Server: %s', $object->getName());
49 protected function getObjectEditShortText($object) {
50 return pht('Edit OAuth Server');
53 protected function getObjectCreateShortText() {
54 return pht('Create OAuth Server');
57 protected function getObjectName() {
58 return pht('OAuth Server');
61 protected function getObjectViewURI($object) {
62 return $object->getViewURI();
65 protected function getCreateNewObjectPolicy() {
66 return $this->getApplication()->getPolicy(
67 PhabricatorOAuthServerCreateClientsCapability::CAPABILITY);
70 protected function buildCustomEditFields($object) {
71 return array(
72 id(new PhabricatorTextEditField())
73 ->setKey('name')
74 ->setLabel(pht('Name'))
75 ->setIsRequired(true)
76 ->setTransactionType(PhabricatorOAuthServerTransaction::TYPE_NAME)
77 ->setDescription(pht('The name of the OAuth application.'))
78 ->setConduitDescription(pht('Rename the application.'))
79 ->setConduitTypeDescription(pht('New application name.'))
80 ->setValue($object->getName()),
81 id(new PhabricatorTextEditField())
82 ->setKey('redirectURI')
83 ->setLabel(pht('Redirect URI'))
84 ->setIsRequired(true)
85 ->setTransactionType(
86 PhabricatorOAuthServerTransaction::TYPE_REDIRECT_URI)
87 ->setDescription(
88 pht('The redirect URI for OAuth handshakes.'))
89 ->setConduitDescription(
90 pht(
91 'Change where this application redirects users to during OAuth '.
92 'handshakes.'))
93 ->setConduitTypeDescription(
94 pht(
95 'New OAuth application redirect URI.'))
96 ->setValue($object->getRedirectURI()),