From c776c0b3b5ee400768e2db41026100591c65dd05 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 30 May 2026 10:19:00 +0800 Subject: [PATCH] fix: rp_cache should reload from DB when cache is disabled --- rbac/userperm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rbac/userperm.py b/rbac/userperm.py index 354e7cd..46fd228 100644 --- a/rbac/userperm.py +++ b/rbac/userperm.py @@ -329,10 +329,10 @@ where a.id = c.userid if userid is None: roles = ['any', 'anonymous'] - if self.rp_caches is None or not roles: + if not _cache_enabled('rbac') or self.rp_caches is None or not roles: env = ServerEnv() async with get_sor_context(env, 'rbac') as sor: - if self.rp_caches is None: + if not _cache_enabled('rbac') or self.rp_caches is None: await self.load_roleperms(sor) if not roles: roles = await self.get_userroles(sor, userid)