Work on docs

This commit is contained in:
Andrew Svetlov
2015-11-06 22:45:20 +08:00
parent f8d76e32ce
commit d02faf69e7
4 changed files with 81 additions and 17 deletions

View File

@@ -38,13 +38,19 @@ class AbstractAuthorizationPolicy(metaclass=abc.ABCMeta):
@asyncio.coroutine
@abc.abstractmethod
def permits(self, identity, permission, context=None):
""" Return True if the identity is allowed the permission in the
current context, else return False"""
"""Check user permissions.
Return True if the identity is allowed the permission in the
current context, else return False.
"""
pass
@asyncio.coroutine
@abc.abstractmethod
def authorized_userid(self, identity):
""" Return the user_id of the user identified by the identity
or 'None' if no user exists related to the identity """
"""Retrieve authorized user id.
Return the user_id of the user identified by the identity
or 'None' if no user exists related to the identity.
"""
pass