From a0b200c4590b809d3de7d56944fd9c4b488ab02a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 21 Aug 2026 19:19:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(rbac):=20=E6=B3=A8=E5=86=8C=E5=BC=80?= =?UTF-8?q?=E5=85=B3=20register=5Fopen=20=E6=A3=80=E6=9F=A5=EF=BC=88appbas?= =?UTF-8?q?e=20params=20=E8=A1=A8=EF=BC=8C0=3D=E5=85=B3=E9=97=AD=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rbac/check_perm.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rbac/check_perm.py b/rbac/check_perm.py index 305712c..33f0d34 100644 --- a/rbac/check_perm.py +++ b/rbac/check_perm.py @@ -100,6 +100,20 @@ async def create_user(sor, ns, roles=[]): }) async def register_user(sor, ns): + # 注册开关检查:appbase params 表 register_open(1=开放,0=关闭),superuser 可在参数管理界面改 + try: + pro = await sor.R('params', {'params_name': 'register_open'}) + if pro and str(pro[0].params_value).strip() == '0': + return { + "status": "error", + "data": { + "message": "注册暂未开放,请联系管理员", + "user": None + } + } + except Exception as e: + debug(f'register_user: register_open check skipped: {e}') + if ns.password != ns.cfm_password: debug('password not match') return False