From 3e781ca2050ba9505a6255dfcffba914a1470c11 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 8 Dec 2022 16:15:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8D=8F=E4=BD=9C=E8=80=85?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/ai_model_manage.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 67b592d1a..3a9ff88ba 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -998,7 +998,11 @@ func isCanDownload(ctx *context.Context, task *models.AiModelManage) bool { if ctx.User == nil { return false } - if ctx.User.IsAdmin || ctx.User.ID == task.UserId || ctx.Repo.HasAccess() { + isCollaborator, err := ctx.Repo.Repository.IsCollaborator(ctx.User.ID) + if err != nil { + log.Info("query error.") + } + if ctx.User.IsAdmin || ctx.User.ID == task.UserId || isCollaborator { return true } if !task.IsPrivate {