Forbid users from using unauthorized credentials in projects and inventories.

Signed-off-by: Yunfan Zhang <yz322@duke.edu>
This commit is contained in:
Yunfan Zhang
2018-07-09 15:04:53 -04:00
parent d5661a0434
commit 270102c188
4 changed files with 41 additions and 8 deletions

View File

@@ -52,6 +52,7 @@ def test_project_copy(post, get, project, organization, scm_credential, alice):
reverse('api:project_copy', kwargs={'pk': project.pk}), alice, expect=200
).data['can_copy'] is False
project.organization.admin_role.members.add(alice)
scm_credential.use_role.members.add(alice)
assert get(
reverse('api:project_copy', kwargs={'pk': project.pk}), alice, expect=200
).data['can_copy'] is True