addRoleChannel grants a channel for the default collection to a role
(role, channel string)
| 71 | |
| 72 | // addRoleChannel grants a channel for the default collection to a role |
| 73 | func (tester *ChannelRevocationTester) addRoleChannel(role, channel string) { |
| 74 | if tester.roleChannels.Channels == nil { |
| 75 | tester.roleChannels.Channels = map[string][]string{} |
| 76 | } |
| 77 | |
| 78 | role = fmt.Sprintf("role:%s", role) |
| 79 | |
| 80 | tester.roleChannels.Channels[role] = append(tester.roleChannels.Channels[role], channel) |
| 81 | tester.roleChannelVersion = tester.restTester.UpdateDoc("roleChannels", tester.roleChannelVersion, string(base.MustJSONMarshal(tester.test, tester.roleChannels))) |
| 82 | tester.restTester.WaitForPendingChanges() |
| 83 | } |
| 84 | |
| 85 | func (tester *ChannelRevocationTester) removeRoleChannel(role, channel string) { |
| 86 | delIdx := -1 |
no test coverage detected