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

Method invalidateAllPrincipals

db/database.go:1924–1933  ·  view source on GitHub ↗

invalidateAllPrincipals invalidates computed channels and roles for all users/roles, for the specified collections:

(ctx context.Context, collectionNames base.ScopeAndCollectionNames, endSeq uint64)

Source from the content-addressed store, hash-verified

1922
1923// invalidateAllPrincipals invalidates computed channels and roles for all users/roles, for the specified collections:
1924func (dbCtx *DatabaseContext) invalidateAllPrincipals(ctx context.Context, collectionNames base.ScopeAndCollectionNames, endSeq uint64) {
1925 base.InfofCtx(ctx, base.KeyAll, "Invalidating channel caches of users/roles...")
1926 users, roles, _ := dbCtx.AllPrincipalIDs(ctx)
1927 for _, name := range users {
1928 dbCtx.invalUserRolesAndChannels(ctx, name, collectionNames, endSeq)
1929 }
1930 for _, name := range roles {
1931 dbCtx.invalRoleChannels(ctx, name, collectionNames, endSeq)
1932 }
1933}
1934
1935// invalUserChannels invalidates a user's computed channels for the specified collections
1936func (dbCtx *DatabaseContext) invalUserChannels(ctx context.Context, username string, collections base.ScopeAndCollectionNames, invalSeq uint64) {

Callers 2

RunMethod · 0.45

Calls 4

AllPrincipalIDsMethod · 0.95
invalRoleChannelsMethod · 0.95
InfofCtxFunction · 0.92

Tested by 1