Browse Source

增加协作者权限

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.12.1^2
zouap 3 years ago
parent
commit
3e781ca205
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      routers/repo/ai_model_manage.go

+ 5
- 1
routers/repo/ai_model_manage.go View File

@@ -998,7 +998,11 @@ func isCanDownload(ctx *context.Context, task *models.AiModelManage) bool {
if ctx.User == nil {
return false
}
if ctx.User.IsAdmin || ctx.User.ID == task.UserId || ctx.Repo.HasAccess() {
isCollaborator, err := ctx.Repo.Repository.IsCollaborator(ctx.User.ID)
if err != nil {
log.Info("query error.")
}
if ctx.User.IsAdmin || ctx.User.ID == task.UserId || isCollaborator {
return true
}
if !task.IsPrivate {


Loading…
Cancel
Save