Преглед на файлове

check acl policy in failover ctx

abhishek9686 преди 4 месеца
родител
ревизия
be1c691eed
променени са 1 файла, в които са добавени 11 реда и са изтрити 0 реда
  1. 11 0
      pro/controllers/failover.go

+ 11 - 0
pro/controllers/failover.go

@@ -415,6 +415,17 @@ func checkfailOverCtx(w http.ResponseWriter, r *http.Request) {
 		)
 		return
 	}
+	if ok := logic.IsPeerAllowed(node, peerNode, true); !ok {
+		logic.ReturnErrorResponse(
+			w,
+			r,
+			logic.FormatError(
+				errors.New("peers are not allowed to communicate"),
+				"badrequest",
+			),
+		)
+		return
+	}
 
 	err = proLogic.CheckFailOverCtx(failOverNode, node, peerNode)
 	if err != nil {