CreateUserNQuads creates the NQuads needed to store a user with the given ID and password in the ACL system.
(userId, password string)
| 173 | // CreateUserNQuads creates the NQuads needed to store a user with the given ID and |
| 174 | // password in the ACL system. |
| 175 | func 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. |
| 196 | func CreateGroupNQuads(groupId string) []*api.NQuad { |
no outgoing calls
no test coverage detected