Skip to content

Commit

Permalink
Fix deepsource warnings. (#5225)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmr committed Apr 16, 2020
1 parent 4980482 commit fd389b0
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions upgrade/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,25 @@ func upgradeACLRules() error {

for _, r := range rs {
newRuleStr := fmt.Sprintf("_:newrule%d", counter)
nquads = append(nquads, &api.NQuad{
nquads = append(nquads, []*api.NQuad{{
Subject: newRuleStr,
Predicate: "dgraph.rule.predicate",
ObjectValue: &api.Value{
Val: &api.Value_StrVal{StrVal: r.Predicate},
},
})

nquads = append(nquads, &api.NQuad{
Subject: newRuleStr,
Predicate: "dgraph.rule.permission",
ObjectValue: &api.Value{
Val: &api.Value_IntVal{IntVal: int64(r.Permission)},
},
{
Subject: newRuleStr,
Predicate: "dgraph.rule.permission",
ObjectValue: &api.Value{
Val: &api.Value_IntVal{IntVal: int64(r.Permission)},
},
},
})

nquads = append(nquads, &api.NQuad{
Subject: group.UID,
Predicate: "dgraph.acl.rule",
ObjectId: newRuleStr,
})
{
Subject: group.UID,
Predicate: "dgraph.acl.rule",
ObjectId: newRuleStr,
}}...)

counter++
}
Expand Down

0 comments on commit fd389b0

Please sign in to comment.