Open circlingthesun opened 6 years ago
If I'm not wrong you can simply pass a factory
argument to your service
Thanks for the tip. I finally got around to upgrading. It would probably helpful to have in the docs. I did the following:
class BusinessACL(object):
def __init__(self, request):
self.request = request
def __acl__(self):
business_id = self.request.matchdict['id']
return [
(Allow, 'group:root', ALL_PERMISSIONS),
(Allow, 'group:admin-%s' % business_id, 'write'),
(Allow, Everyone, 'read'),
]
calendar_export = Service(
name='calendar',
path='/api/business/{id:\d+}/calendar.ics',
description="ICS export for business",
factory=BusinessACL
)
Is there an example of how to use an acl with a Service in version 3? The docs only mention Resources.