aio-libs / aiohttp-security

auth and permissions for aiohttp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Permission lists - Restrict route to multiple permission levels.

bitnom opened this issue · comments

I will now begin work on a PR to add support for restricting routes to multiple permissions like this:

async def protected_page(self, request):
    await check_permission(request, ['protected', 'level1', 'level2'])
    response = web.Response(body=b'You are on protected page')
    return response

Discussion welcome.