Skip to content

Commit

Permalink
n
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha committed Mar 4, 2024
1 parent 00076c5 commit 646c747
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ func (bl *FxBlockchain) SetAuth(ctx context.Context, on peer.ID, subject peer.ID
}

func (bl *FxBlockchain) authorized(pid peer.ID, action string) bool {
if bl.authorizer == "" {
if bl.authorizer == bl.h.ID() { //to cover the cases where in poolHost mode
return action == actionReplicateInPool
}
switch action {
Expand Down
2 changes: 1 addition & 1 deletion exchange/fx_exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ func (e *FxExchange) SetAuth(ctx context.Context, on peer.ID, subject peer.ID, a

func (e *FxExchange) authorized(pid peer.ID, action string, cid string) bool {
log.Debugw("checking authorization", "pid", pid, "action", action, "cid", cid)
if e.authorizer == "" && action != actionAuth {
if e.authorizer == e.h.ID() && action != actionAuth { //to cover the cases where in poolHost mode
// If no authorizer is set allow all.
return true
} else if e.authorizer == "" && action == actionAuth {
Expand Down

0 comments on commit 646c747

Please sign in to comment.