Page MenuHomePhabricator

Fix isReadable() and isWritable() in SearchService
ClosedPublic

Authored by epriestley on Mar 28 2017, 7:51 PM.
Tags
None
Referenced Files
F18210127: D17571.id42274.diff
Mon, Aug 18, 11:59 PM
F18208112: D17571.id42281.diff
Mon, Aug 18, 7:58 PM
F18194668: D17571.id.diff
Sun, Aug 17, 11:33 AM
F18184827: D17571.diff
Sat, Aug 16, 2:23 PM
F17867908: D17571.diff
Mon, Jul 28, 6:54 AM
F17631427: D17571.diff
Jul 10 2025, 1:06 PM
Unknown Object (File)
Jun 30 2025, 3:58 AM
Unknown Object (File)
Jun 30 2025, 1:57 AM
Subscribers
None

Details

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().

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable