fix(access): Add HTTP/Method=DELETE as valid option for object delete/destroy.
ref: #442 #454
This commit is contained in:
@ -184,7 +184,10 @@ class OrganizationMixin:
|
||||
|
||||
view_action = 'change'
|
||||
|
||||
elif self.action == 'destroy':
|
||||
elif(
|
||||
self.action == 'destroy'
|
||||
or getattr(self.request._stream, 'method', '') == 'DELETE'
|
||||
):
|
||||
|
||||
view_action = 'delete'
|
||||
|
||||
|
@ -120,7 +120,10 @@ class OrganizationPermissionMixin(
|
||||
obj = view.get_object()
|
||||
)
|
||||
|
||||
elif view.action == 'destroy':
|
||||
elif(
|
||||
view.action == 'destroy'
|
||||
or getattr(view.request._stream, 'method', '') == 'DELETE'
|
||||
):
|
||||
|
||||
view_action = 'delete'
|
||||
|
||||
@ -146,7 +149,7 @@ class OrganizationPermissionMixin(
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
||||
if view_action is None:
|
||||
|
||||
raise ValueError('view_action could not be defined.')
|
||||
|
Reference in New Issue
Block a user