This commit is contained in:
yumoqing 2026-03-20 21:44:37 +08:00
parent ebd3765a45
commit 9a454eed85

View File

@ -58,11 +58,14 @@ where a.id = c.userid
self.ur_caches[userid] = sorted(list(set(roles))) self.ur_caches[userid] = sorted(list(set(roles)))
def check_roles_path(self, roles, path): def check_roles_path(self, roles, path):
ret = False
for role in roles: for role in roles:
paths = self.rp_caches.get(role) paths = self.rp_caches.get(role)
if not paths: if not paths:
continue
if path in paths:
return True
return False return False
return path in paths
async def is_user_has_path_perm(self, userid, path): async def is_user_has_path_perm(self, userid, path):
roles = self.ur_caches.get(userid) roles = self.ur_caches.get(userid)