Counterpart of https://vanadium-review.googlesource.com/16427
MultiPart: 5/6
Change-Id: Id3fb3e52203bf271a19e9cd14ac6d5f509cf0dd5
diff --git a/clients/shell/go/src/v.io/x/chat/channel.go b/clients/shell/go/src/v.io/x/chat/channel.go
index 28c304d..d6af3b1 100644
--- a/clients/shell/go/src/v.io/x/chat/channel.go
+++ b/clients/shell/go/src/v.io/x/chat/channel.go
@@ -303,13 +303,16 @@
s := vdl.ChatClient(member.Path)
- // The AllowedServersPolicy options require that the server matches the
- // blessings we got when we globbed it.
- opts := make([]rpc.CallOpt, len(member.Blessings))
- for i, blessing := range member.Blessings {
- opts[i] = options.AllowedServersPolicy{security.BlessingPattern(blessing)}
+ var opts []rpc.CallOpt
+ if len(member.Blessings) > 0 {
+ // The server must match the blessings we got when we globbed it.
+ // The AllowedServersPolicy options require that the server matches the
+ acl := access.AccessList{In: make([]security.BlessingPattern, len(member.Blessings))}
+ for i, b := range member.Blessings {
+ acl.In[i] = security.BlessingPattern(b)
+ }
+ opts = append(opts, options.ServerAuthorizer{acl})
}
-
if err := s.SendMessage(ctx, messageText, opts...); err != nil {
return // member has disconnected.
}