From 8308e2e83d4a0e88167ec005de808e8a070aee21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Fri, 3 Sep 2021 15:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BE=B9=E7=BC=98=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E6=97=A0=E6=B3=95=E4=B8=8B=E8=BD=BD=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/rpc/services/service_file_chunk.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/rpc/services/service_file_chunk.go b/internal/rpc/services/service_file_chunk.go index 5771b852..67a193ce 100644 --- a/internal/rpc/services/service_file_chunk.go +++ b/internal/rpc/services/service_file_chunk.go @@ -3,6 +3,7 @@ package services import ( "context" "github.com/TeaOSLab/EdgeAPI/internal/db/models" + rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" ) @@ -31,7 +32,7 @@ func (this *FileChunkService) CreateFileChunk(ctx context.Context, req *pb.Creat // FindAllFileChunkIds 获取的一个文件的所有片段IDs func (this *FileChunkService) FindAllFileChunkIds(ctx context.Context, req *pb.FindAllFileChunkIdsRequest) (*pb.FindAllFileChunkIdsResponse, error) { // 校验请求 - _, _, err := this.ValidateAdminAndUser(ctx, 0, -1) + _, _, err := this.ValidateNodeId(ctx, rpcutils.UserTypeNode, rpcutils.UserTypeAdmin, rpcutils.UserTypeUser) if err != nil { return nil, err } @@ -50,7 +51,7 @@ func (this *FileChunkService) FindAllFileChunkIds(ctx context.Context, req *pb.F // DownloadFileChunk 下载文件片段 func (this *FileChunkService) DownloadFileChunk(ctx context.Context, req *pb.DownloadFileChunkRequest) (*pb.DownloadFileChunkResponse, error) { // 校验请求 - _, _, err := this.ValidateAdminAndUser(ctx, 0, -1) + _, _, err := this.ValidateNodeId(ctx, rpcutils.UserTypeNode, rpcutils.UserTypeAdmin, rpcutils.UserTypeUser) if err != nil { return nil, err }