MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / getUserModNQuad

Function getUserModNQuad

acl/acl.go:539–556  ·  view source on GitHub ↗
(ctx context.Context, txn *dgo.Txn, userId string,
	groupId string)

Source from the content-addressed store, hash-verified

537}
538
539func getUserModNQuad(ctx context.Context, txn *dgo.Txn, userId string,
540 groupId string) (*api.NQuad, error) {
541 group, err := queryGroup(ctx, txn, groupId)
542 if err != nil {
543 return nil, err
544 }
545 if group == nil {
546 return nil, fmt.Errorf("group %q does not exist", groupId)
547 }
548
549 createUserGroupNQuads := &api.NQuad{
550 Subject: userId,
551 Predicate: "dgraph.user.group",
552 ObjectId: group.Uid,
553 }
554
555 return createUserGroupNQuads, nil
556}
557
558func queryGroup(ctx context.Context, txn *dgo.Txn, groupid string,
559 fields ...string) (group *Group, err error) {

Callers 1

userModFunction · 0.85

Calls 2

queryGroupFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…