You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return nil, echo.NewHTTPError(http.StatusUnauthorized, "Can not connect - could not check user")
160
+
return nil, echo.NewHTTPError(
161
+
http.StatusBadRequest,
162
+
"Failed to retrieve list of CNSIs",
163
+
"Failed to retrieve list of CNSIs: %v", err,
164
+
)
158
165
}
159
166
160
-
if user.Admin {
161
-
return nil, echo.NewHTTPError(http.StatusUnauthorized, "Can not connect - admins are not allowed to connect to user created endpoints")
167
+
for _, cnsi := range cnsiList {
168
+
if cnsi.Creator == userID || len(cnsi.Creator) == 0 {
169
+
_, ok := p.GetCNSITokenRecord(cnsi.GUID, userID)
170
+
if ok {
171
+
p.ClearCNSIToken(*cnsi, userID)
172
+
}
173
+
}
162
174
}
163
175
164
-
if cnsiRecord.Creator != userID {
165
-
return nil, echo.NewHTTPError(http.StatusUnauthorized, "Can not connect - non-admins are not allowed to connect to endpoints created by other non-admins")
176
+
if len(cnsiRecord.Creator) != 0 && cnsiRecord.Creator != userID {
177
+
return nil, echo.NewHTTPError(http.StatusUnauthorized, "Can not connect - users are not allowed to connect to personal endpoints created by other users")
0 commit comments