|
|
@@ -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.") |
|
|
|