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

Method UnmarshalJSON

auth/user.go:778–792  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

776}
777
778func (user *userImpl) UnmarshalJSON(data []byte) error {
779 if err := base.JSONUnmarshal(data, &user.userImplBody); err != nil {
780 return err
781 } else if err := base.JSONUnmarshal(data, &user.roleImpl); err != nil {
782 return err
783 }
784
785 // Migrate "admin_roles" field:
786 if user.OldExplicitRoles_ != nil {
787 user.ExplicitRoles_ = ch.AtSequence(base.SetFromArray(user.OldExplicitRoles_), 1)
788 user.OldExplicitRoles_ = nil
789 }
790
791 return nil
792}

Callers

nothing calls this directly

Calls 2

JSONUnmarshalFunction · 0.92
SetFromArrayFunction · 0.92

Tested by

no test coverage detected