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

Method removeRole

rest/revocation_test.go:58–70  ·  view source on GitHub ↗
(user, role string)

Source from the content-addressed store, hash-verified

56}
57
58func (tester *ChannelRevocationTester) removeRole(user, role string) {
59 delIdx := -1
60 roles := tester.roles.Roles[user]
61 for idx, val := range roles {
62 if val == fmt.Sprintf("role:%s", role) {
63 delIdx = idx
64 break
65 }
66 }
67 tester.roles.Roles[revocationTestUser] = append(roles[:delIdx], roles[delIdx+1:]...)
68 tester.roleVersion = tester.restTester.UpdateDoc("userRoles", tester.roleVersion, string(base.MustJSONMarshal(tester.test, tester.roles)))
69 tester.restTester.WaitForPendingChanges()
70}
71
72// addRoleChannel grants a channel for the default collection to a role
73func (tester *ChannelRevocationTester) addRoleChannel(role, channel string) {

Callers 15

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

Calls 3

MustJSONMarshalFunction · 0.92
UpdateDocMethod · 0.80
WaitForPendingChangesMethod · 0.45

Tested by

no test coverage detected