Page MenuHomePhabricator

Fix isReadable() and isWritable() in SearchService
ClosedPublic

Authored by epriestley on Mar 28 2017, 7:51 PM.
Tags
None
Referenced Files
F13046345: D17571.diff
Thu, Apr 18, 9:03 AM
Unknown Object (File)
Wed, Apr 17, 3:18 PM
Unknown Object (File)
Thu, Apr 11, 7:26 AM
Unknown Object (File)
Sat, Apr 6, 7:22 AM
Unknown Object (File)
Sat, Apr 6, 3:26 AM
Unknown Object (File)
Sun, Mar 31, 5:32 AM
Unknown Object (File)
Mar 19 2024, 4:11 AM
Unknown Object (File)
Feb 20 2024, 10:51 PM
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