From 2c9c42dd516a6f3602efde1d5391794b5e783ac8 Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 12 Mar 2026 08:36:34 +0100 Subject: [PATCH] Add Groups --- entrypoint.go | 9 +++++++++ tools/nats_caller.go | 1 + 2 files changed, 10 insertions(+) diff --git a/entrypoint.go b/entrypoint.go index b317aaa..60b50ab 100644 --- a/entrypoint.go +++ b/entrypoint.go @@ -305,6 +305,15 @@ func NewRequest(collection LibDataEnum, user string, peerID string, groups []str return &Request{Collection: collection, User: user, PeerID: peerID, Groups: groups, Caller: caller} } +func NewRequestInfoAdmin(collection LibDataEnum, user string, groups []string, caller *tools.HTTPCaller) *Request { + p, err := GetMySelf() + peerID := "" + if p != nil && err == nil { + peerID = p.GetID() + } + return &Request{Collection: collection, User: user, PeerID: peerID, Groups: groups, Caller: caller, admin: true} +} + func NewRequestAdmin(collection LibDataEnum, caller *tools.HTTPCaller) *Request { return &Request{Collection: collection, Caller: caller, admin: true} } diff --git a/tools/nats_caller.go b/tools/nats_caller.go index c1aa2c1..9e9fa48 100644 --- a/tools/nats_caller.go +++ b/tools/nats_caller.go @@ -17,6 +17,7 @@ type NATSResponse struct { FromApp string `json:"from_app"` Datatype DataType `json:"datatype"` User string `json:"user"` + Groups []string `json:"groups"` Method int `json:"method"` SearchAttr string `json:"search_attr"` Payload []byte `json:"payload"`