Browse Source

fix-2208

pull/2302/head
liuzx 3 years ago
parent
commit
6eb4949154
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      routers/repo/dataset.go

+ 8
- 2
routers/repo/dataset.go View File

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


Loading…
Cancel
Save