Skip to content

Instantly share code, notes, and snippets.

@birdayz
Created January 4, 2019 01:44
Show Gist options
  • Save birdayz/75accaf0f971f23d0311be1c83d59675 to your computer and use it in GitHub Desktop.
Save birdayz/75accaf0f971f23d0311be1c83d59675 to your computer and use it in GitHub Desktop.
m := &api.Mutation{
CommitNow: true,
Set: []*api.NQuad{
&api.NQuad{Subject: request.GetEntityUid(), Predicate: "access.to", ObjectId: request.GetResourceUid(), Facets: []*api.Facet{
&api.Facet{
Key: "permission",
Value: []byte(request.GetAction()),
ValType: api.Facet_STRING,
Tokens: []string{request.GetAction()},
},
&api.Facet{
Key: "inherit",
Value: []byte(strconv.FormatBool(request.GetInherit())),
ValType: api.Facet_BOOL,
},
}},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment