From 0debd7739cd2f34756bacc14e48177c7fe4ba677 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 5 Sep 2023 16:02:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9SDK=20API=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=92=88=E5=AF=B9=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86=E5=91=98=E6=9D=83=E9=99=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/api/v1/repo/attachments.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routers/api/v1/repo/attachments.go b/routers/api/v1/repo/attachments.go index 74d40d822d..795a62b14e 100644 --- a/routers/api/v1/repo/attachments.go +++ b/routers/api/v1/repo/attachments.go @@ -40,9 +40,13 @@ func checkDatasetPermission(ctx *context.APIContext) string { if err != nil { log.Warn("can not find repo permission for user", err) return "dataset.query_dataset_fail" + } else { + log.Info("permission.AccessMode=" + string(permission.AccessMode)) + } + if permission.AccessMode >= models.AccessModeAdmin { + return "" } if !permission.CanWrite(models.UnitTypeDatasets) { - return "error.no_right" } return "" -- 2.34.1