mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Further tweaks
This commit is contained in:
parent
b8a3117c83
commit
2c1db2a902
@ -60,11 +60,11 @@ class InvenTreeMetadata(SimpleMetadata):
|
|||||||
del actions[method]
|
del actions[method]
|
||||||
|
|
||||||
# Add a 'DELETE' action if we are allowed to delete
|
# Add a 'DELETE' action if we are allowed to delete
|
||||||
if check(user, table, 'delete'):
|
if 'DELETE' in view.allowed_methods and check(user, table, 'delete'):
|
||||||
actions['DELETE'] = True
|
actions['DELETE'] = True
|
||||||
|
|
||||||
# Add a 'VIEW' action if we are allowed to view
|
# Add a 'VIEW' action if we are allowed to view
|
||||||
if check(user, table, 'view'):
|
if 'GET' in view.allowed_methods and check(user, table, 'view'):
|
||||||
actions['GET'] = True
|
actions['GET'] = True
|
||||||
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
@ -186,8 +186,9 @@ class APITests(InvenTreeAPITestCase):
|
|||||||
|
|
||||||
actions = self.getActions(url)
|
actions = self.getActions(url)
|
||||||
|
|
||||||
|
self.assertEqual(len(actions), 2)
|
||||||
self.assertIn('POST', actions)
|
self.assertIn('POST', actions)
|
||||||
self.assertEqual(len(actions), 1)
|
self.assertIn('GET', actions)
|
||||||
|
|
||||||
def test_detail_endpoint_actions(self):
|
def test_detail_endpoint_actions(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user