MCPcopy
hub / github.com/dgraph-io/dgraph / CreateUserNQuads

Function CreateUserNQuads

acl/utils.go:175–193  ·  view source on GitHub ↗

CreateUserNQuads creates the NQuads needed to store a user with the given ID and password in the ACL system.

(userId, password string)

Source from the content-addressed store, hash-verified

173// CreateUserNQuads creates the NQuads needed to store a user with the given ID and
174// password in the ACL system.
175func CreateUserNQuads(userId, password string) []*api.NQuad {
176 return []*api.NQuad{
177 {
178 Subject: "_:newuser",
179 Predicate: "dgraph.xid",
180 ObjectValue: &api.Value{Val: &api.Value_StrVal{StrVal: userId}},
181 },
182 {
183 Subject: "_:newuser",
184 Predicate: "dgraph.password",
185 ObjectValue: &api.Value{Val: &api.Value_StrVal{StrVal: password}},
186 },
187 {
188 Subject: "_:newuser",
189 Predicate: "dgraph.type",
190 ObjectValue: &api.Value{Val: &api.Value_StrVal{StrVal: "dgraph.type.User"}},
191 },
192 }
193}
194
195// CreateGroupNQuads cretes NQuads needed to store a group with the give ID.
196func CreateGroupNQuads(groupId string) []*api.NQuad {

Callers 3

upsertGrootFunction · 0.92
runMethod · 0.92
userAddFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected