MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / addRoleChannel

Method addRoleChannel

rest/revocation_test.go:73–83  ·  view source on GitHub ↗

addRoleChannel grants a channel for the default collection to a role

(role, channel string)

Source from the content-addressed store, hash-verified

71
72// addRoleChannel grants a channel for the default collection to a role
73func (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
85func (tester *ChannelRevocationTester) removeRoleChannel(role, channel string) {
86 delIdx := -1

Callers 15

TestRevocationScenario1Function · 0.80
TestRevocationScenario2Function · 0.80
TestRevocationScenario3Function · 0.80
TestRevocationScenario4Function · 0.80
TestRevocationScenario5Function · 0.80
TestRevocationScenario6Function · 0.80
TestRevocationScenario7Function · 0.80
TestRevocationScenario8Function · 0.80
TestRevocationScenario9Function · 0.80
TestRevocationScenario10Function · 0.80
TestRevocationScenario11Function · 0.80
TestRevocationScenario12Function · 0.80

Calls 3

MustJSONMarshalFunction · 0.92
UpdateDocMethod · 0.80
WaitForPendingChangesMethod · 0.45

Tested by

no test coverage detected