Browse Source

Merge branch 'V20220328' of git.openi.org.cn:OpenI/aiforge into cb-train

tags/v1.22.3.2^2
lewis 4 years ago
parent
commit
dce11de9a7
1 changed files with 13 additions and 7 deletions
  1. +13
    -7
      routers/repo/attachment.go

+ 13
- 7
routers/repo/attachment.go View File

@@ -241,14 +241,20 @@ func GetAttachment(ctx *context.Context) {
}

if dataSet != nil {
isPermit, err := models.GetUserDataSetPermission(dataSet, ctx.User)
if err != nil {
ctx.Error(http.StatusInternalServerError, "GetUserDataSetPermission", err.Error())
return
}
if !isPermit {
ctx.Error(http.StatusNotFound)
if !ctx.IsSigned {
ctx.SetCookie("redirect_to", setting.AppSubURL+ctx.Req.URL.RequestURI(), 0, setting.AppSubURL)
ctx.Redirect(setting.AppSubURL + "/user/login")
return
} else {
isPermit, err := models.GetUserDataSetPermission(dataSet, ctx.User)
if err != nil {
ctx.Error(http.StatusInternalServerError, "GetUserDataSetPermission", err.Error())
return
}
if !isPermit {
ctx.Error(http.StatusNotFound)
return
}
}
}



Loading…
Cancel
Save