adjust self
This commit is contained in:
@@ -271,15 +271,15 @@ func (ri *ResourceInstance[T]) GetPeerGroups() ([]ResourcePartnerITF, []map[stri
|
||||
groups = append(groups, p.GetPeerGroups())
|
||||
}
|
||||
if len(groups) == 0 {
|
||||
id, err := utils.GetMySelf((&peer.Peer{}).GetAccessor(&tools.APIRequest{
|
||||
pp, err := utils.GetMySelf((&peer.Peer{}).GetAccessor(&tools.APIRequest{
|
||||
Admin: true,
|
||||
}))
|
||||
if err != nil {
|
||||
if err != nil || pp == nil {
|
||||
return partners, groups
|
||||
}
|
||||
groups = []map[string][]string{
|
||||
{
|
||||
id: {"*"},
|
||||
pp.GetID(): {"*"},
|
||||
},
|
||||
}
|
||||
// TODO make allow all only for self.
|
||||
@@ -356,14 +356,14 @@ func (ri *ResourcePartnerShip[T]) GetPricingsProfiles(peerID string, groups []st
|
||||
|
||||
func (rp *ResourcePartnerShip[T]) GetPeerGroups() map[string][]string {
|
||||
if len(rp.PeerGroups) == 0 {
|
||||
id, err := utils.GetMySelf((&peer.Peer{}).GetAccessor(&tools.APIRequest{
|
||||
pp, err := utils.GetMySelf((&peer.Peer{}).GetAccessor(&tools.APIRequest{
|
||||
Admin: true,
|
||||
}))
|
||||
if err != nil {
|
||||
if err != nil || pp == nil {
|
||||
return rp.PeerGroups
|
||||
}
|
||||
return map[string][]string{
|
||||
id: {"*"},
|
||||
pp.GetID(): {"*"},
|
||||
}
|
||||
}
|
||||
return rp.PeerGroups
|
||||
|
||||
Reference in New Issue
Block a user