mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-12 15:58:38 -05:00
Merge pull request #3166 from AlanCoding/3163_host_box
Allow POST box for host list to show
This commit is contained in:
+2
-2
@@ -427,8 +427,8 @@ class HostAccess(BaseAccess):
|
|||||||
return obj and self.user in obj.inventory.read_role
|
return obj and self.user in obj.inventory.read_role
|
||||||
|
|
||||||
def can_add(self, data):
|
def can_add(self, data):
|
||||||
if not data or 'inventory' not in data:
|
if not data: # So the browseable API will work
|
||||||
return False
|
return Inventory.accessible_objects(self.user, 'admin_role').exists()
|
||||||
|
|
||||||
# Checks for admin or change permission on inventory.
|
# Checks for admin or change permission on inventory.
|
||||||
inventory_pk = get_pk_from_dict(data, 'inventory')
|
inventory_pk = get_pk_from_dict(data, 'inventory')
|
||||||
|
|||||||
Reference in New Issue
Block a user