Browse Source

Merge remote-tracking branch 'origin/V20220926' into point-v2

tags/v1.22.9.2^2
chenyifan01 3 years ago
parent
commit
bd759a0e40
2 changed files with 10 additions and 5 deletions
  1. +9
    -5
      models/dataset.go
  2. +1
    -0
      services/cloudbrain/resource/resource_specification.go

+ 9
- 5
models/dataset.go View File

@@ -131,13 +131,17 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)
permission = false
datasets[i].Repo.GetOwner()
if !permission {
isCollaborator, _ := datasets[i].Repo.IsCollaborator(opts.User.ID)
isInRepoTeam,_:=datasets[i].Repo.IsInRepoTeam(opts.User.ID)

if isCollaborator ||isInRepoTeam {
log.Info("Collaborator user may visit the attach.")
if datasets[i].Repo.OwnerID==opts.User.ID{
permission = true
}else{
isCollaborator, _ := datasets[i].Repo.IsCollaborator(opts.User.ID)
isInRepoTeam,_:=datasets[i].Repo.IsInRepoTeam(opts.User.ID)

if isCollaborator ||isInRepoTeam {
permission = true
}
}

}

permissionMap[datasets[i].ID] = permission


+ 1
- 0
services/cloudbrain/resource/resource_specification.go View File

@@ -229,6 +229,7 @@ func filterExclusiveSpecs(r []*models.Specification, userId int64) []*models.Spe
if isMember {
specs = append(specs, spec)
specMap[spec.ID] = ""
break
}
}
}


Loading…
Cancel
Save