1
0
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:
Alan Rominger 2018-03-26 12:06:57 -04:00 committed by GitHub
commit e38955e1fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -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

View File

@ -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