mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
Merge pull request #1670 from AlanCoding/no_credential
Inventory source can_change - remove credential check
This commit is contained in:
commit
e38955e1fa
@ -928,7 +928,6 @@ class InventorySourceAccess(BaseAccess):
|
||||
if obj and obj.inventory:
|
||||
return (
|
||||
self.user.can_access(Inventory, 'change', obj.inventory, None) and
|
||||
self.check_related('credential', Credential, data, obj=obj, role_field='use_role') and
|
||||
self.check_related('source_project', Project, data, obj=obj, role_field='use_role')
|
||||
)
|
||||
# Can't change inventory sources attached to only the inventory, since
|
||||
|
@ -155,7 +155,7 @@ def test_host_access(organization, inventory, group, user, group_factory):
|
||||
def test_inventory_source_credential_check(rando, inventory_source, credential):
|
||||
inventory_source.inventory.admin_role.members.add(rando)
|
||||
access = InventorySourceAccess(rando)
|
||||
assert not access.can_change(inventory_source, {'credential': credential})
|
||||
assert not access.can_attach(inventory_source, credential, 'credentials', {'id': credential.pk})
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
|
Loading…
Reference in New Issue
Block a user