spaceView method

JsonMap spaceView(
  1. String principalId,
  2. String spaceId
)

The API SpaceView of spaceId for principalId: the highest level of its channels.

Implementation

JsonMap spaceView(String principalId, String spaceId) => {
  'space': spaces[spaceId],
  'level': _highest([
    for (final c in channels.values)
      if (c.spaceId == spaceId && c.access[principalId] != null)
        c.access[principalId]!,
  ]),
  'capabilities': <Object?>[],
};