fix: close platform access re-review findings
This commit is contained in:
@@ -80,3 +80,12 @@ func RequirePlatformMenuAccess() gin.HandlerFunc {
|
||||
ctx.Next()
|
||||
}
|
||||
}
|
||||
|
||||
func requirePlatformRoot(ctx *gin.Context) bool {
|
||||
claims, err := middleware.ParseAuth(ctx)
|
||||
if err == nil && claims.Role == "root" {
|
||||
return true
|
||||
}
|
||||
infra.Response.Error(ctx, errcode.ErrPermissionDenied)
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user