# The Cornice service.bills_service = Service("bills", "/api/bills", factory=BillsListContext)
# The Context factory:class BillListContext(object): def __init__(self, request): pass
@property def __acl__(self): return [ (Allow, "role:buyer", "get_bills"), (Allow, "role:seller", "get_bills"), ]
# And the view function is then:@bills_service.get( content_type="application/json", accept="application/json", permission="get_bills", )def get_bills(request): # …