Skip to content

Set minimum role for importing projects to Maintainer

What does this MR do and why?

This MR updates all of GitLab's importers to restrict users from importing projects into groups if they have role developer or below. From now on, only Maintainer/Owner/Admin is allowed to import projects into groups. Personal namespace should not be affected.

It updates all importers UI and API endpoints to fail import and return an appropriate error (User is not allowed to import projects) when user is a developer or below.

This work is considered as part of deprecation work in ~"group::import" that needs to complete in 16.0. Deprecation announcements have been done in a milestone prior.

Mentions #387891 (closed)

Screenshots or screen recordings

Developer trying to import a project to a group via UI

projectimportlevel.mov

Verifications

GitHub

Developer - UI

image

Developer - API

image

GitLab File-based Project Import

Developer - UI

filebased-ui.mov

Developer - API

image

GitLab Direct Transfer

Done in !117306 (merged)

Import by URL

Developer - UI

url-ui.mov

Developer - API

Import by URL is not available via API

BitBucket Cloud

Requires OAuth setup locally which I did not manage to configure. But BitBucket Cloud import leads to the same CreateService we use everywhere

BitBucket Server

Developer - UI

bitbucket-server-ui.mov

Developer - API

image

FogBugz

Similarly to BitBucket Cloud, FogBugz Importer also uses the same ProjectCreator used everywhere

Gitea

Developer - UI

image

Developer - API

Gitea Import via API is not available. Trying to set it as github host in GitHub API returns 404.

Manifest file

Uses Import By URL method which is already validated above.

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by George Koltsov

Merge request reports

Loading