def verify_access_service(self, client):
"""
Verify the token's client / delegate has access to the service
"""
try:
service = yield Service.get(self.request.client_id)
except couch.NotFound:
raise Unauthorized("Unknown service '{}'"
.format(self.request.client_id))
has_access = client.authorized(self.requested_access, service)
if not has_access:
raise Unauthorized("'{}' does not have '{}' to service '{}'"
.format(client.id, self.requested_access,
self.request.client_id))
raise Return(True)
评论列表
文章目录