Allow override of "create" permission in API
This commit is contained in:
parent
fa700d53ad
commit
4474f30718
|
@ -151,7 +151,11 @@ class APIMasterView2(APIMasterView):
|
|||
# create
|
||||
if cls.creatable:
|
||||
cls.establish_method('collection_post')
|
||||
resource.add_view(cls.collection_post, permission='{}.create'.format(permission_prefix))
|
||||
if hasattr(cls, 'permission_to_create'):
|
||||
permission = cls.permission_to_create
|
||||
else:
|
||||
permission = '{}.create'.format(permission_prefix)
|
||||
resource.add_view(cls.collection_post, permission=permission)
|
||||
|
||||
# view
|
||||
if cls.viewable:
|
||||
|
|
Loading…
Reference in a new issue