def view_annotation(id, format=None): ann = Annotation.fetch(id) if ann is None: return abort(404) if g.authorize(ann, 'read', g.user): if ann['consumer'] == 'annotateit': user = User.fetch(ann['user']) else: user = None return {'annotation': ann, 'user': user} abort(401)