diff --git a/rbac/types/structs.go b/rbac/types/structs.go index 7b40be135..de2ba9ac3 100644 --- a/rbac/types/structs.go +++ b/rbac/types/structs.go @@ -18,7 +18,7 @@ type ( Role struct { Name string `json:"rolename"` Users []string `json:"users"` - Permissions []string `json:"users"` + Permissions []string `json:"permissions"` } // @todo: read resource information diff --git a/sam/websocket/incoming_message.go b/sam/websocket/incoming_message.go index d70820be7..c81127af3 100644 --- a/sam/websocket/incoming_message.go +++ b/sam/websocket/incoming_message.go @@ -36,7 +36,7 @@ func (s *Session) messageUpdate(ctx context.Context, payload *incoming.Payload) if err != nil { return err } - return s.sendMessageChannel(uint64toa(msg.ChannelID), &outgoing.MessageUpdate{request.ID, msg.Message}) + return s.sendMessageChannel(uint64toa(msg.ChannelID), &outgoing.MessageUpdate{ID: request.ID, Message: msg.Message}) } func (s *Session) messageDelete(ctx context.Context, payload *incoming.Payload) error { @@ -49,5 +49,5 @@ func (s *Session) messageDelete(ctx context.Context, payload *incoming.Payload) return err } - return s.sendMessageChannel(request.ChannelID, &outgoing.MessageDelete{request.ID}) + return s.sendMessageChannel(request.ChannelID, &outgoing.MessageDelete{ID: request.ID}) } diff --git a/sam/websocket/outgoing/messages.go b/sam/websocket/outgoing/messages.go index 1a4ed72b1..9b35af869 100644 --- a/sam/websocket/outgoing/messages.go +++ b/sam/websocket/outgoing/messages.go @@ -3,7 +3,7 @@ package outgoing type ( Message struct { ID string `json:"id"` - ChannelID string `json:"cid""` + ChannelID string `json:"cid"` Message string `json:"m"` Type string `json:"t"` ReplyTo string `json:"rid"`