Skip to content

Commit

Permalink
Fix chan history admin assignment flagging
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammed-madi committed Feb 12, 2024
1 parent c74439e commit 032d0e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions db/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,17 @@ func (dbc *DatabaseContext) UpdateCollectionExplicitChannels(ctx context.Context
updatedExplicitChannels = ch.TimedSet{}
}
expChannels := princ.CollectionExplicitChannels(scopeName, collectionName).Copy()
allExplicitChannels := expChannels.Copy()
allExplicitChannels.Add(updatedExplicitChannels)
changed := updatedExplicitChannels.UpdateAtSequence(updatedCollectionAccess.ExplicitChannels_, seq)
if changed {
princ.SetCollectionExplicitChannels(scopeName, collectionName, updatedExplicitChannels, seq)
history := auth.CalculateHistory(ctx, princ.GetChannelInvalSeq(), expChannels, updatedExplicitChannels, princ.ChannelHistory())
for channel, hist := range history {
hist.AdminAssigned = true
history[channel] = hist
if _, ok := allExplicitChannels[channel]; ok {
hist.AdminAssigned = true
history[channel] = hist
}
}
princ.SetChannelHistory(history)
}
Expand Down

0 comments on commit 032d0e6

Please sign in to comment.