fix: change permission level for instance listing to visitor and making sure all instances could be listed for all users
This commit is contained in:
+1
-7
@@ -295,7 +295,7 @@ func DeleteProxyHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func ListProxiesHandler(w http.ResponseWriter, r *http.Request) {
|
||||
userID, err := utils.Auth(w, r, http.MethodGet)
|
||||
_, err := utils.Auth(w, r, http.MethodGet)
|
||||
if err != nil {
|
||||
utils.SendErrorResponse(w, http.StatusUnauthorized, err.Error())
|
||||
postLog.Warning(fmt.Sprintf("[ListProxiesHandler] Auth failed: %v", err))
|
||||
@@ -319,12 +319,6 @@ func ListProxiesHandler(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if instance.UserID != userID {
|
||||
postLog.Error(fmt.Sprintf("[ListProxiesHandler] Instance not found for user %d", userID))
|
||||
utils.SendErrorResponse(w, http.StatusNotFound, "Instance not found")
|
||||
return
|
||||
}
|
||||
|
||||
configContent, err := os.ReadFile(instance.ConfigPath)
|
||||
if err != nil {
|
||||
postLog.Error(fmt.Sprintf("[ListProxiesHandler] Failed to read config file %s: %v", instance.ConfigPath, err))
|
||||
|
||||
Reference in New Issue
Block a user