visibility_and_access_controls.md 3.3 KB
Newer Older
1 2 3 4
---
type: reference
---

5
# Visibility and access controls **(CORE ONLY)**
6

E
Evan Read 已提交
7
GitLab allows administrators to:
8 9 10 11 12

- Control access and visibility to GitLab resources including branches and projects.
- Select from which hosting sites code can be imported into GitLab.
- Select the protocols permitted to access GitLab.
- Enable or disable repository mirroring.
E
Evan Read 已提交
13
- Prevent non-administrators from deleting projects
14
  ([introduced](https://gitlab.com/gitlab-org/gitlab/issues/5615) in GitLab 12.0).
15
  **(PREMIUM ONLY)**
16 17 18 19 20 21 22

To access the visibility and access control options:

1. Log in to GitLab as an admin.
1. Go to **Admin Area > Settings > General**.
1. Expand the **Visibility and access controls** section.

23 24
## Import sources

25
Choose from which hosting sites users can
26 27 28 29
[import their projects](../../project/import/index.md).

![import sources](img/import_sources.png)

30 31 32
## Enabled Git access protocols

> [Introduced][ce-4696] in GitLab 8.10.
33

34 35
With GitLab's access restrictions, you can select with which protocols users can communicate with
GitLab.
36

37
From the **Enabled Git access protocols** dropdown, select one of the following:
38 39 40 41 42

- Both SSH and HTTP(S)
- Only SSH
- Only HTTP(s)

43
![Settings Overview](img/access_restrictions.png)
44

45
When both SSH and HTTP(S) are enabled, your users can choose either protocol.
46

47
When only one protocol is enabled:
48 49 50 51 52 53

- The project page will only show the allowed protocol's URL, with no option to
  change it.
- A tooltip will be shown when you hover over the URL's protocol, if an action
  on the user's part is required, e.g. adding an SSH key, or setting a password.

54
![Project URL with SSH only access](img/restricted_url.png)
55 56 57 58

On top of these UI restrictions, GitLab will deny all Git actions on the protocol
not selected.

T
Tomasz Maczukin 已提交
59 60
CAUTION: **Important:**
Starting with [GitLab 10.7][ce-18021], HTTP(s) protocol will be allowed for
61
Git clone/fetch requests done by GitLab Runner from CI/CD Jobs, even if
T
Tomasz Maczukin 已提交
62 63
_Only SSH_ was selected.

64
> **Note:** Please keep in mind that disabling an access protocol does not actually
T
Tomasz Maczukin 已提交
65 66 67
block access to the server itself. The ports used for the protocol, be it SSH or
HTTP, will still be accessible. What GitLab does is restrict access on the
application level.
68

69 70 71 72 73
## Allow mirrors to be set up for projects

> [Introduced][ee-3586] in GitLab 10.3.

This option is enabled by default. By disabling it, both pull and push mirroring will no longer
74
work in every repository and can only be re-enabled by an admin on a per-project basis.
75 76 77

![Mirror settings](img/mirror_settings.png)

78 79 80 81 82 83 84 85 86 87 88 89
<!-- ## Troubleshooting

Include any troubleshooting steps that you can foresee. If you know beforehand what issues
one might have when setting this up, or when something is changed, or on upgrading, it's
important to describe those, too. Think of things that may go wrong and include them here.
This is important to minimize requests for support, and to avoid doc comments with
questions that you know someone might ask.

Each scenario can be a third-level heading, e.g. `### Getting error message X`.
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->

90 91 92
[ce-4696]: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/4696
[ce-18021]: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/18021
[ee-3586]: https://gitlab.com/gitlab-org/gitlab/merge_requests/3586