Add basic support for create and update actions in API views

customer views only for now, will add more upon further testing
This commit is contained in:
Lance Edgar 2019-08-25 16:02:59 -05:00
parent 7c0d9c4f93
commit 3d3ace1c2a
2 changed files with 81 additions and 5 deletions

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2018 Lance Edgar
# Copyright © 2010-2019 Lance Edgar
#
# This file is part of Rattail.
#
@ -49,10 +49,18 @@ class CustomerView(APIMasterView):
def collection_get(self):
return self._collection_get()
@view(permission='customers.create')
def collection_post(self):
return self._collection_post()
@view(permission='customers.view')
def get(self):
return self._get()
@view(permission='customers.edit')
def post(self):
return self._post()
def includeme(config):
config.scan(__name__)