From 76e4e46b57c629cfce2f993bb6a9b01199036e8d Mon Sep 17 00:00:00 2001 From: yokowu <18836617@qq.com> Date: Mon, 18 Aug 2025 17:19:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=86=99=E5=85=A5=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=90=91=E5=90=8E=E5=85=BC=E5=AE=B9,=20=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E5=85=B6=E5=AE=83=E9=9D=9E=E5=90=8E=E5=8F=B0=E7=9A=84=E5=9C=B0?= =?UTF-8?q?=E6=96=B9=E5=86=99=E5=85=A5=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/ent/rule/rule.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/ent/rule/rule.go b/backend/ent/rule/rule.go index bc42c1f..06e7377 100644 --- a/backend/ent/rule/rule.go +++ b/backend/ent/rule/rule.go @@ -41,7 +41,8 @@ func (p PermissionHook) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, perm, ok := ctx.Value(PermissionKey{}).(*domain.Permissions) if !ok { - return nil, errcode.ErrPermission.Wrap(fmt.Errorf("failed to get permission")) + // 没有权限,直接返回. 用于向后兼容 + return p.next.Mutate(ctx, m) } if perm.IsAdmin {