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

Method RemoveUserFromGroup

dgraphapi/acl.go:290–310  ·  view source on GitHub ↗
(userName, groupName string)

Source from the content-addressed store, hash-verified

288}
289
290func (hc *HTTPClient) RemoveUserFromGroup(userName, groupName string) error {
291 const query = `mutation updateUser($name: String!, $groupName: String!) {
292 updateUser(input: {filter: {name: {eq: $name}},remove: {groups: [{ name: $groupName }]}}) {
293 user {
294 name
295 groups {
296 name
297 }
298 }
299 }
300 }`
301 params := GraphQLParams{
302 Query: query,
303 Variables: map[string]interface{}{
304 "name": userName,
305 "groupName": groupName,
306 },
307 }
308 _, err := hc.RunGraphqlQuery(params, true)
309 return err
310}
311
312func (hc *HTTPClient) RemovePredicateFromGroup(group, predicate string) error {
313 const query = `mutation updateGroup($name: String!, $rules: [String!]!) {

Calls 1

RunGraphqlQueryMethod · 0.95