|
@@ -375,7 +375,7 @@ func user_handleList(w http.ResponseWriter, r *http.Request) {
|
|
sendErrorResponse(w, "User not logged in")
|
|
sendErrorResponse(w, "User not logged in")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if userinfo.IsAdmin() {
|
|
|
|
|
|
+ if authAgent.CheckAuth(r) {
|
|
entries, _ := sysdb.ListTable("auth")
|
|
entries, _ := sysdb.ListTable("auth")
|
|
var results [][]interface{}
|
|
var results [][]interface{}
|
|
for _, keypairs := range entries {
|
|
for _, keypairs := range entries {
|
|
@@ -397,10 +397,6 @@ func user_handleList(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
jsonString, _ := json.Marshal(results)
|
|
jsonString, _ := json.Marshal(results)
|
|
sendJSONResponse(w, string(jsonString))
|
|
sendJSONResponse(w, string(jsonString))
|
|
- } else if authAgent.CheckAuth(r) {
|
|
|
|
- allUserNames := authAgent.ListUsers()
|
|
|
|
- js, _ := json.Marshal(allUserNames)
|
|
|
|
- sendJSONResponse(w, string(js))
|
|
|
|
} else {
|
|
} else {
|
|
sendErrorResponse(w, "Permission Denied")
|
|
sendErrorResponse(w, "Permission Denied")
|
|
}
|
|
}
|