Browse Source

Merge pull request '修复数据集选择的bug' (#2879) from V20220908.patch into develop

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/2879
tags/v1.22.9.2
ychao_1983 3 years ago
parent
commit
e774e79618
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      models/dataset.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


Loading…
Cancel
Save