|
@@ -241,14 +241,20 @@ func GetAttachment(ctx *context.Context) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if dataSet != nil { |
|
|
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 |
|
|
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 |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|