MCPcopy
hub / github.com/tinode/chat / computePerUserAcsUnion

Method computePerUserAcsUnion

server/topic.go:285–304  ·  view source on GitHub ↗

computePerUserAcsUnion computes want and given permissions unions over all topic's subscribers.

()

Source from the content-addressed store, hash-verified

283
284// computePerUserAcsUnion computes want and given permissions unions over all topic's subscribers.
285func (t *Topic) computePerUserAcsUnion() {
286 wantUnion := types.ModeNone
287 givenUnion := types.ModeNone
288 for _, pud := range t.perUser {
289 if pud.isChan {
290 continue
291 }
292 wantUnion |= pud.modeWant
293 givenUnion |= pud.modeGiven
294 }
295
296 if t.isChan {
297 // Apply standard channel permissions to channel topics.
298 wantUnion |= types.ModeCChnReader
299 givenUnion |= types.ModeCChnReader
300 }
301
302 t.modeWantUnion = wantUnion
303 t.modeGivenUnion = givenUnion
304}
305
306// unregisterSession implements all logic following receipt of a leave
307// request via the Topic.unreg channel.

Callers 3

anotherUserSubMethod · 0.95
evictUserMethod · 0.95
topicInitFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected