|
|
|
@@ -612,12 +612,12 @@ func GetDatasetStatus(ctx *context.Context) { |
|
|
|
func DatasetIsCollaborator(ctx *context.Context, DatasetID int64) bool { |
|
|
|
dataset, err := models.GetDatasetByID(DatasetID) |
|
|
|
if err != nil { |
|
|
|
log.Info("query dataset error:", DatasetID) |
|
|
|
log.Error("query dataset error:", err.Error()) |
|
|
|
return false |
|
|
|
} else { |
|
|
|
repo, err := models.GetRepositoryByID(dataset.RepoID) |
|
|
|
if err != nil { |
|
|
|
log.Info("query repo error.") |
|
|
|
log.Error("query repo error:", err.Error()) |
|
|
|
} else { |
|
|
|
repo.GetOwner() |
|
|
|
if ctx.User != nil { |
|
|
|
@@ -628,14 +628,12 @@ func DatasetIsCollaborator(ctx *context.Context, DatasetID int64) bool { |
|
|
|
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.") |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|