loadTopicAuths static method

TopicAuth loadTopicAuths(
  1. LoggedInUser loggedInUser
)

Loads topic authorizations for the loggedInUser.

Implementation

static TopicAuth loadTopicAuths(LoggedInUser loggedInUser) {
  TopicAuth topicAuth = TopicAuth(loggedInUser);
  topicAuth.connect(PubSubSupervisor.supervisor);

  PubSubSupervisor.supervisor.listen(
    topicAuth.getTopic(),
        (phoenixChannel) {
      topicAuth.listTopics();
    },
    messagingTopic: false,
  );

  return topicAuth;
}