(ctx context.Context, ns, refreshTs uint64)
| 314 | } |
| 315 | |
| 316 | func refreshAclCache(ctx context.Context, ns, refreshTs uint64) error { |
| 317 | req := &Request{ |
| 318 | req: &api.Request{ |
| 319 | Query: queryAcls, |
| 320 | ReadOnly: true, |
| 321 | StartTs: refreshTs, |
| 322 | }, |
| 323 | doAuth: NoAuthorize, |
| 324 | } |
| 325 | |
| 326 | ctx = x.AttachNamespace(ctx, ns) |
| 327 | queryResp, err := (&Server{}).doQuery(ctx, req) |
| 328 | if err != nil { |
| 329 | return errors.Errorf("unable to retrieve acls: %v", err) |
| 330 | } |
| 331 | groups, err := acl.UnmarshalGroups(queryResp.GetJson(), "allAcls") |
| 332 | if err != nil { |
| 333 | return err |
| 334 | } |
| 335 | |
| 336 | worker.AclCachePtr.Update(ns, groups) |
| 337 | glog.V(2).Infof("Updated the ACL cache for namespace: %#x", ns) |
| 338 | return nil |
| 339 | |
| 340 | } |
| 341 | |
| 342 | func RefreshACLs(ctx context.Context) { |
| 343 | for ns := range schema.State().Namespaces() { |
no test coverage detected