aiohttp-security/demo/session_auth/auth_policy.py

12 lines
301 B
Python
Raw Normal View History

2016-05-13 01:40:57 +00:00
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