Home GnuPG

Fix isReadable() and isWritable() in SearchService
c40be811ea9bUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Fix isReadable() and isWritable() in SearchService

Summary:
Ref T12450. Minor cleanup:

  • setRoles() has no callers.
  • getRoles() has no callers (these two methods are leftovers from an earlier iteration of the change).
  • The hasRole() logic doesn't work since nothing calls setRole().
  • hasRole() has only isreadable/iswritable as callers.
  • The isReadable()/isWritable() logic doesn't work since hasRole() doesn't work.

Instead, just check if there are any readable/writable hosts. Host already inherits its config from Service so this gets the same answer without any fuss.

Also add some read/write constants to make grepping this stuff a little easier.

Test Plan:

  • Grepped for all removed symbols, saw only newer-generation calls in Host.
  • See next diff for use of isWritable().

Reviewers: chad, 20after4

Reviewed By: 20after4

Maniphest Tasks: T12450

Differential Revision: https://secure.phabricator.com/D17571

Details

Provenance
epriestley <git@epriestley.com>Authored on Mar 28 2017, 9:47 PM
Parents
rPHABc22693ff2915: Remove PhabricatorSearchEngineTestCase
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHABc40be811ea9b: Fix isReadable() and isWritable() in SearchService (authored by epriestley <git@epriestley.com>).Mar 28 2017, 10:58 PM