mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
Policy - filter app engines where the user can't see the application from panel editing
Summary: Fixes T7118. This does the basic "filter the list" thing, though it ends up being a little manual since I guess this hasn't come up before? There is also potential weird behavior if the user was using an app and lost access to it - they will have nothing selected on edit - but I think this is actually correct behavior in this circumstance. Test Plan: used a user who couldn't get access to the "quick create" apps and noted that the dropdown list on dashboard panel create was missing the expected engines ran `arc unit --everything` to verify abstract method implemented everywhere Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7118 Differential Revision: https://secure.phabricator.com/D11687
This commit is contained in:
parent
1272abbfd9
commit
5a9df1a225
54 changed files with 97 additions and 44 deletions
|
@ -7,7 +7,7 @@ final class AlmanacDeviceSearchEngine
|
|||
return pht('Almanac Devices');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorAlmanacApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class AlmanacNetworkSearchEngine
|
|||
return pht('Almanac Networks');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorAlmanacApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class AlmanacServiceSearchEngine
|
|||
return pht('Almanac Services');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorAlmanacApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@ final class PhabricatorCommitSearchEngine
|
|||
return pht('Commits');
|
||||
}
|
||||
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorDiffusionApplication';
|
||||
}
|
||||
|
||||
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
||||
$saved = new PhabricatorSavedQuery();
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorCalendarEventSearchEngine
|
|||
return pht('Calendar Events');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorCalendarApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorConduitSearchEngine
|
|||
return pht('Conduit Methods');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorConduitApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorCountdownSearchEngine
|
|||
return pht('Countdowns');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorCountdownApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,17 @@ final class PhabricatorDashboardPanelSearchApplicationCustomField
|
|||
$engines = id(new PhutilSymbolLoader())
|
||||
->setAncestorClass('PhabricatorApplicationSearchEngine')
|
||||
->loadObjects();
|
||||
$all_apps = id(new PhabricatorApplicationQuery())
|
||||
->setViewer($this->getViewer())
|
||||
->withUnlisted(false)
|
||||
->withInstalled(true)
|
||||
->execute();
|
||||
foreach ($engines as $index => $engine) {
|
||||
if (!isset($all_apps[$engine->getApplicationClassName()])) {
|
||||
unset($engines[$index]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$options = array();
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorDashboardPanelSearchEngine
|
|||
return pht('Dashboard Panels');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorDashboardApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorDashboardSearchEngine
|
|||
return pht('Dashboards');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorDashboardApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class DifferentialRevisionSearchEngine
|
|||
return pht('Differential Revisions');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorDifferentialApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ final class DivinerAtomSearchEngine extends PhabricatorApplicationSearchEngine {
|
|||
return pht('Documentation Atoms');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorDivinerApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class DrydockBlueprintSearchEngine
|
|||
return pht('Drydock Blueprints');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorDrydockApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class DrydockLeaseSearchEngine
|
|||
return pht('Drydock Leases');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorDrydockApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ final class DrydockLogSearchEngine extends PhabricatorApplicationSearchEngine {
|
|||
return pht('Drydock Logs');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorDrydockApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class DrydockResourceSearchEngine
|
|||
return pht('Drydock Resources');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorDrydockApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@ final class PhabricatorFeedSearchEngine
|
|||
return pht('Feed Stories');
|
||||
}
|
||||
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorFeedApplication';
|
||||
}
|
||||
|
||||
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
||||
$saved = new PhabricatorSavedQuery();
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorFileSearchEngine
|
|||
return pht('Files');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorFilesApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorFlagSearchEngine
|
|||
return pht('Flags');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorFlagsApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ final class FundBackerSearchEngine
|
|||
return pht('Fund Backers');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorFundApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class FundInitiativeSearchEngine
|
|||
return pht('Fund Initiatives');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorFundApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class HarbormasterBuildPlanSearchEngine
|
|||
return pht('Harbormaster Build Plans');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorHarbormasterApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class HarbormasterBuildableSearchEngine
|
|||
return pht('Harbormaster Buildables');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorHarbormasterApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ final class HeraldRuleSearchEngine extends PhabricatorApplicationSearchEngine {
|
|||
return pht('Herald Rules');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorHeraldApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class HeraldTranscriptSearchEngine
|
|||
return pht('Herald Transcripts');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorHeraldApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class LegalpadDocumentSearchEngine
|
|||
return pht('Legalpad Documents');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorLegalpadApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ final class LegalpadDocumentSignatureSearchEngine
|
|||
return pht('Legalpad Signatures');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorLegalpadApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorMacroSearchEngine
|
|||
return pht('Macros');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorMacroApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorMailingListSearchEngine
|
|||
return pht('Mailing Lists');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorMailingListsApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ final class ManiphestTaskSearchEngine
|
|||
return pht('Tasks');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorManiphestApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorAppSearchEngine
|
|||
return pht('Applications');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorApplicationsApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorNotificationSearchEngine
|
|||
return pht('Notifications');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorNotificationsApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorOAuthServerClientSearchEngine
|
|||
return pht('OAuth Clients');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorOAuthServerApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PassphraseCredentialSearchEngine
|
|||
return pht('Passphrase Credentials');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPassphraseApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@ final class PhabricatorPasteSearchEngine
|
|||
return pht('Pastes');
|
||||
}
|
||||
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPasteApplication';
|
||||
}
|
||||
|
||||
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
||||
$saved = new PhabricatorSavedQuery();
|
||||
$saved->setParameter(
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorPeopleLogSearchEngine
|
|||
return pht('Account Activity');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPeopleApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorPeopleSearchEngine
|
|||
return pht('Users');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPeopleApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ final class PholioMockSearchEngine extends PhabricatorApplicationSearchEngine {
|
|||
return pht('Pholio Mocks');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPholioApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,10 @@ final class PhortuneCartSearchEngine
|
|||
return pht('Phortune Orders');
|
||||
}
|
||||
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPhortuneApplication';
|
||||
}
|
||||
|
||||
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
||||
$saved = new PhabricatorSavedQuery();
|
||||
|
||||
|
|
|
@ -18,6 +18,10 @@ final class PhortuneChargeSearchEngine
|
|||
return pht('Phortune Charges');
|
||||
}
|
||||
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPhortuneApplication';
|
||||
}
|
||||
|
||||
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
||||
$saved = new PhabricatorSavedQuery();
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@ final class PhortuneMerchantSearchEngine
|
|||
return pht('Phortune Merchants');
|
||||
}
|
||||
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPhortuneApplication';
|
||||
}
|
||||
|
||||
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
||||
$saved = new PhabricatorSavedQuery();
|
||||
|
||||
|
|
|
@ -28,6 +28,10 @@ final class PhortuneSubscriptionSearchEngine
|
|||
return pht('Phortune Subscriptions');
|
||||
}
|
||||
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPhortuneApplication';
|
||||
}
|
||||
|
||||
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
||||
$saved = new PhabricatorSavedQuery();
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ final class PhrequentSearchEngine extends PhabricatorApplicationSearchEngine {
|
|||
return pht('Phrequent Time');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPhrequentApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@ final class PhrictionSearchEngine
|
|||
return pht('Wiki Documents');
|
||||
}
|
||||
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPhrictionApplication';
|
||||
}
|
||||
|
||||
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
||||
$saved = new PhabricatorSavedQuery();
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PonderQuestionSearchEngine
|
|||
return pht('Ponder Questions');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorPonderApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorProjectSearchEngine
|
|||
return pht('Projects');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorProjectApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,10 @@ final class ReleephBranchSearchEngine
|
|||
return pht('Releeph Branches');
|
||||
}
|
||||
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorReleephApplication';
|
||||
}
|
||||
|
||||
public function setProduct(ReleephProject $product) {
|
||||
$this->product = $product;
|
||||
return $this;
|
||||
|
|
|
@ -7,7 +7,7 @@ final class ReleephProductSearchEngine
|
|||
return pht('Releeph Products');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorReleephApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,10 @@ final class ReleephRequestSearchEngine
|
|||
return pht('Releeph Pull Requests');
|
||||
}
|
||||
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorReleephApplication';
|
||||
}
|
||||
|
||||
public function setBranch(ReleephBranch $branch) {
|
||||
$this->branch = $branch;
|
||||
return $this;
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorRepositoryPushLogSearchEngine
|
|||
return pht('Push Logs');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorDiffusionApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorRepositorySearchEngine
|
|||
return pht('Repositories');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorDiffusionApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -243,9 +243,7 @@ abstract class PhabricatorApplicationSearchEngine {
|
|||
return $this->application;
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
throw new PhutilMethodNotImplementedException();
|
||||
}
|
||||
abstract public function getApplicationClassName();
|
||||
|
||||
|
||||
/* -( Constructing Engines )----------------------------------------------- */
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorSearchApplicationSearchEngine
|
|||
return pht('Fulltext Results');
|
||||
}
|
||||
|
||||
protected function getApplicationClassName() {
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorSearchApplication';
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@ final class PhabricatorSlowvoteSearchEngine
|
|||
return pht('Slowvotes');
|
||||
}
|
||||
|
||||
public function getApplicationClassName() {
|
||||
return 'PhabricatorSlowvoteApplication';
|
||||
}
|
||||
|
||||
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
||||
$saved = new PhabricatorSavedQuery();
|
||||
$saved->setParameter(
|
||||
|
|
Loading…
Reference in a new issue