mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 12:20:45 -03:30
start capability to return False for manual projects
This commit is contained in:
parent
959342a5fd
commit
d734145c38
@ -264,6 +264,10 @@ class BaseAccess(object):
|
||||
elif display_method == 'copy' and isinstance(obj, (Group, Host)):
|
||||
user_capabilities['copy'] = user_capabilities['edit']
|
||||
continue
|
||||
elif display_method == 'start' and isinstance(obj, (Project)) and obj.scm_type == '':
|
||||
# Special case to return False for a manual project
|
||||
user_capabilities['start'] = False
|
||||
continue
|
||||
|
||||
# Preprocessing before the access method is called
|
||||
data = {}
|
||||
|
||||
@ -309,6 +309,11 @@ def test_prefetch_jt_copy_capability(job_template, project, inventory, machine_c
|
||||
]}], JobTemplate, rando)
|
||||
assert qs[0].capabilities_cache == {'copy': True}
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_manual_projects_no_update(project, get, admin_user):
|
||||
response = get(reverse('api:project_detail', args=[project.pk]), admin_user, expect=200)
|
||||
assert not response.data['summary_fields']['user_capabilities']['start']
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_group_update_capabilities_possible(group, inventory_source, admin_user):
|
||||
group.inventory_source = inventory_source
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user