hostViewers method

Set<String> hostViewers(
  1. FakeHost h
)

The people who see h (07 2.12): owners, the assignee and the holders of a valid grant terminal on it.

Implementation

Set<String> hostViewers(FakeHost h) => {
  for (final p in people.values)
    if (p.kind == 'user' && p.isOwner) p.id,
  ?h.assignedUserId,
  for (final g in grants.values)
    if (g['revoked_at'] == null &&
        g['target_kind'] == 'host' &&
        g['target_id'] == h.id &&
        g['subject_kind'] == 'user')
      g['subject_id']! as String,
};