aiohttp-security/demo/session_auth/auth_policy.py

12 lines
301 B
Python

import asyncio
from aiohttp_security.abc import AbstractAuthorizationPolicy
class StubAuthorizationPolicy(AbstractAuthorizationPolicy):
@asyncio.coroutine
def permits(self, identity, permission, context=None):
if identity == permission:
return True
return False