inventory source can_change rm credential check

This commit is contained in:
AlanCoding 2018-03-23 15:25:11 -04:00
parent 1595947ae2
commit 894eeee979
No known key found for this signature in database
GPG Key ID: FD2C3C012A72926B
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