This commit is contained in:
yumoqing 2024-11-14 11:03:17 +08:00
parent 76da02338e
commit 674ec1626e
2 changed files with 3 additions and 2 deletions

View File

@ -86,7 +86,7 @@ class AuthAPI:
def __init__(self): def __init__(self):
self.conf = getConfig() self.conf = getConfig()
async def checkUserPermission(self, user, path): async def checkUserPermission(self, request, user, path):
# print('************* checkUserPermission() use default one ****************') # print('************* checkUserPermission() use default one ****************')
return True return True
@ -153,7 +153,7 @@ class AuthAPI:
path = request.path path = request.path
userinfo = await get_session_userinfo(request) userinfo = await get_session_userinfo(request)
user = userinfo.userid user = userinfo.userid
is_ok = await self.checkUserPermission(user, path) is_ok = await self.checkUserPermission(request, user, path)
t2 = time.time() t2 = time.time()
ip = get_client_ip(None, request) ip = get_client_ip(None, request)
if is_ok: if is_ok:

View File

@ -5,6 +5,7 @@ from appPublic.folderUtils import ProgramPath
from appPublic.jsonConfig import getConfig from appPublic.jsonConfig import getConfig
from ahserver.configuredServer import ConfiguredServer from ahserver.configuredServer import ConfiguredServer
from ahserver.serverenv import ServerEnv from ahserver.serverenv import ServerEnv
from appPublic.jsonConfig import getConfig
def webapp(init_func): def webapp(init_func):
parser = argparse.ArgumentParser(prog="Sage") parser = argparse.ArgumentParser(prog="Sage")