Only used for deleted role, logic is for channels in channel_history and roles in role_history
(roleVbSeq uint64, chanEntries []auth.GrantHistorySequencePair)
| 149 | |
| 150 | // Only used for deleted role, logic is for channels in channel_history and roles in role_history |
| 151 | func getCurrentRoleChanEntryOverlap(roleVbSeq uint64, chanEntries []auth.GrantHistorySequencePair) []auth.GrantHistorySequencePair { |
| 152 | var overlapEntries []auth.GrantHistorySequencePair |
| 153 | var entry auth.GrantHistorySequencePair |
| 154 | for _, chanEntry := range chanEntries { |
| 155 | // default |
| 156 | entry = auth.GrantHistorySequencePair{StartSeq: roleVbSeq, EndSeq: chanEntry.EndSeq} |
| 157 | // role was assigned to user after chan was removed from role, no entry |
| 158 | if roleVbSeq > chanEntry.EndSeq { |
| 159 | continue |
| 160 | // role was assigned to user before chan was assigned to role |
| 161 | } else if roleVbSeq < chanEntry.StartSeq { |
| 162 | entry = auth.GrantHistorySequencePair{StartSeq: chanEntry.StartSeq, EndSeq: chanEntry.EndSeq} |
| 163 | } |
| 164 | overlapEntries = append(overlapEntries, entry) |
| 165 | } |
| 166 | |
| 167 | return overlapEntries |
| 168 | } |
| 169 | |
| 170 | // Only used for deleted role, logic is for channels in channel_history and roles in role_history |
| 171 | func getHistoricRoleChanEntryOverlap(roleEntries []auth.GrantHistorySequencePair, chanEntries []auth.GrantHistorySequencePair) []auth.GrantHistorySequencePair { |
no outgoing calls
no test coverage detected