From 6eb4949154ff5f91c3d22c5428104bc84985bf6c Mon Sep 17 00:00:00 2001 From: liuzx Date: Thu, 16 Jun 2022 10:25:01 +0800 Subject: [PATCH] fix-2208 --- routers/repo/dataset.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/routers/repo/dataset.go b/routers/repo/dataset.go index d3ae1624b..e4272c053 100755 --- a/routers/repo/dataset.go +++ b/routers/repo/dataset.go @@ -623,10 +623,16 @@ func DatasetIsCollaborator(ctx *context.Context, DatasetID int64) bool { if ctx.User != nil { if repo.Owner.IsOrganization() { if repo.Owner.IsUserPartOfOrg(ctx.User.ID) { - log.Info("org user may visit the attach.") - return true + for _, t := range repo.Owner.Teams { + if t.IsMember(ctx.User.ID) && t.HasRepository(repo.ID) { + return true + } + } + log.Info("org user can visit the attach.") + return false } } + isCollaborator, _ := repo.IsCollaborator(ctx.User.ID) if isCollaborator { log.Info("Collaborator user may visit the attach.")