This commit is contained in:
yumoqing 2025-10-20 14:12:06 +08:00
parent a22066dff4
commit 2f983b1e3d
4 changed files with 10 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -2,6 +2,12 @@ from ahserver.auth_api import AuthAPI
from ahserver.serverenv import ServerEnv from ahserver.serverenv import ServerEnv
from rbac.check_perm import objcheckperm, get_user_roles, checkUserPassword, register_user, register_auth_method, create_org, create_user from rbac.check_perm import objcheckperm, get_user_roles, checkUserPassword, register_user, register_auth_method, create_org, create_user
from rbac.set_role_perms import set_role_perm, set_role_perms from rbac.set_role_perms import set_role_perm, set_role_perms
from rbac.userperm import UserPermisions
async def get_owner_orgid(sor, orgid):
env = ServerEnv()
dbname = env.get_module_dbname()
return '0'
def load_rbac(): def load_rbac():
AuthAPI.checkUserPermission = objcheckperm AuthAPI.checkUserPermission = objcheckperm
@ -14,5 +20,6 @@ def load_rbac():
env.set_role_perm = set_role_perm env.set_role_perm = set_role_perm
env.set_role_perms = set_role_perms env.set_role_perms = set_role_perms
env.register_auth_method = register_auth_method env.register_auth_method = register_auth_method
env.get_owner_orgid = get_owner_orgid

View File

@ -1,5 +1,6 @@
import time import time
from sqlor.dbpools import DBPools from sqlor.dbpools import DBPools
from appPublic.Singleton import SingletonDecorator
class CacheUP: class CacheUP:
def __init__(self, userid, paths): def __init__(self, userid, paths):
@ -15,6 +16,7 @@ where a.id = c.userid
self.touch_time = time.time() self.touch_time = time.time()
return self.paths return self.paths
@SingletonDecorator
class UserPermisions: class UserPermisions:
def __init__(self, max_cache_user=10000): def __init__(self, max_cache_user=10000):
self.max_cache_user = max_cache_user self.max_cache_user = max_cache_user