mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-26 10:23:28 +08:00
Service list and minio status (#13480)
### What problem does this PR solve? 1. Resolve standard user can access admin service 2. Get RAGFlow service status 3. Fix minio status fetching ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -60,6 +60,10 @@ func (h *KnowledgebaseHandler) getUserID(c *gin.Context) (string, common.ErrorCo
|
||||
return "", code, err
|
||||
}
|
||||
|
||||
if *user.IsSuperuser {
|
||||
return "", common.CodeForbidden, ErrForbidden
|
||||
}
|
||||
|
||||
return user.ID, common.CodeSuccess, nil
|
||||
}
|
||||
|
||||
@@ -97,6 +101,7 @@ var (
|
||||
ErrMissingAuth = &HTTPError{Code: common.CodeUnauthorized, Message: "Missing Authorization header"}
|
||||
// ErrInvalidToken indicates invalid access token
|
||||
ErrInvalidToken = &HTTPError{Code: common.CodeUnauthorized, Message: "Invalid access token"}
|
||||
ErrForbidden = &HTTPError{Code: common.CodeForbidden, Message: "Forbidden user"}
|
||||
)
|
||||
|
||||
// CreateKB handles the create knowledge base request
|
||||
|
||||
Reference in New Issue
Block a user