Project admin manual SCM Type creation bug fix

There was a bug in tower where project admin was not allowed to create
a project with manual SCM type. This was because, the project base dir
was only set from `settings.PROJECTS_ROOT`, if the user role was either
admin or auditor. This has been updated by also allowing it to set when
user is a project admin.

Signed-off-by: Vismay Golwala <vgolwala@redhat.com>
This commit is contained in:
Vismay Golwala 2019-03-20 16:01:33 -04:00
parent 68d7532d01
commit df11a7fd3d

View File

@ -220,7 +220,8 @@ class ApiV1ConfigView(APIView):
if request.user.is_superuser \
or request.user.is_system_auditor \
or Organization.accessible_objects(request.user, 'admin_role').exists() \
or Organization.accessible_objects(request.user, 'auditor_role').exists():
or Organization.accessible_objects(request.user, 'auditor_role').exists() \
or Organization.accessible_objects(request.user, 'project_admin_role').exists():
data.update(dict(
project_base_dir = settings.PROJECTS_ROOT,
project_local_paths = Project.get_local_path_choices(),