MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / RemovePredicateFromGroup

Method RemovePredicateFromGroup

dgraphapi/acl.go:312–333  ·  view source on GitHub ↗
(group, predicate string)

Source from the content-addressed store, hash-verified

310}
311
312func (hc *HTTPClient) RemovePredicateFromGroup(group, predicate string) error {
313 const query = `mutation updateGroup($name: String!, $rules: [String!]!) {
314 updateGroup(input: {filter: {name: {eq: $name}},remove: {rules: $rules}}) {
315 group {
316 name
317 rules {
318 predicate
319 permission
320 }
321 }
322 }
323 }`
324 params := GraphQLParams{
325 Query: query,
326 Variables: map[string]interface{}{
327 "name": group,
328 "rules": []string{predicate},
329 },
330 }
331 _, err := hc.RunGraphqlQuery(params, true)
332 return err
333}
334
335func (hc *HTTPClient) UpdateGroup(name string, setRules []AclRule, removeRules []string) (*AclGroup, error) {
336 const query = `mutation updateGroup($name: String!, $set: SetGroupPatch, $remove: RemoveGroupPatch){

Callers 1

TestDeleteRuleMethod · 0.80

Calls 1

RunGraphqlQueryMethod · 0.95

Tested by 1

TestDeleteRuleMethod · 0.64