Welcome to mirror list, hosted at ThFree Co, Russian Federation.

share_project_with_groups.md « members « project « user « doc - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 420e51f580b52dba799750f936f2b2364c65597d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
---
stage: Data Stores
group: Tenant Scale
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
---

# Share a project with a group **(FREE ALL)**

When you want a group to have access to your project,
you can invite [a group](../../group/index.md) to the project.
The group's direct and inherited members get access to the project, which becomes a *shared project*.

In this case, inherited members are members that are inherited from parent groups into the groups that are shared.
Only members of the group that is shared get access to the project.
If you want to give members of a subgroup of the group you are sharing access to the project, you have to share the subgroup.

The following table provides an overview of the group members that get access to a shared project.

| Group member source                                              | Access to shared project          |
|------------------------------------------------------------------|------------------------|
| Direct member of the group that is shared                        | **{check-circle}** Yes |
| Inherited member of the group that is shared                        | **{check-circle}** Yes |
| Direct member of a subgroup, but not of the group that is shared | **{dotted-circle}** No |
| Inherited member of a subgroup, but not of the group that is shared | **{dotted-circle}** No |

## Example

For a project that was created by `Group 1`:

- The members of `Group 1` have access to the project.
- The owner of `Group 1` can invite `Group 2` to the project.
  This way, members of both `Group 1` and `Group 2` have access to the shared project.

## Prerequisites

To invite a group to a project, you must be at least one of the following:

- Explicitly defined as a [member](index.md) of the project.
- Explicitly defined as a member of a group or subgroup that has access to the project.
- An administrator.

In addition:

- You must be a member of the group or the subgroup being invited.

- The [visibility level](../../public_access.md) of the group you're inviting
  must be at least as restrictive as that of the project. For example, you can invite:
  - A _private_ group to a _private_ project
  - A _private_ group to an _internal_ project.
  - A _private_ group to a _public_ project.
  - An _internal_ group to an _internal_ project.
  - An _internal_ group to a _public_ project.
  - A _public_ group to a _public_ project.

- If a group in the project's hierarchy [does not allow projects to be shared with groups](../../group/access_and_permissions.md#prevent-a-project-from-being-shared-with-groups), the option to **Invite a group** is not available.
- If the project's root ancestor group [does not allow the project to be shared outside the hierarchy](../../group/access_and_permissions.md#prevent-group-sharing-outside-the-group-hierarchy), the invited group or subgroup must be in the project's [namespace](../../namespace/index.md).
  For example, a project in the namespace `group/subgroup01/project`:
  - Can be shared with `group/subgroup02` or `group/subgroup01/subgroup03`.
  - Cannot be shared with `group_abc`.

## Share a project with a group

> - [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/247208) in GitLab 13.11 from a form to a modal window [with a flag](../../feature_flags.md). Disabled by default.
> - Modal window [enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/247208) in GitLab 14.8.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/352526) in GitLab 14.9. [Feature flag `invite_members_group_modal`](https://gitlab.com/gitlab-org/gitlab/-/issues/352526) removed.

Similar to how you [share a group with another group](../../group/manage.md#share-a-group-with-another-group),
you can share a project with a group by inviting that group to the project.

To invite a group to a project:

1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Members**.
1. Select **Invite a group**.
1. **Select a group** you want to add to the project.
1. **Select a role** you want to assign to the group.
1. Optional. Select an **Access expiration date**.
1. Select **Invite**.

The following members are given access to the project:

- All direct group members.
- Inherited group members.
- Members of other groups that have access to the group being invited (by [group share](../../group/manage.md#share-a-group-with-another-group))

In addition:

- On the group's page, the project is listed on the **Shared projects** tab.
- On the project's **Members** page, the group is listed on the **Groups** tab.
- From [GitLab 16.6](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134623),
  the invited group's name and membership source will be masked unless:
  - the group is public, or
  - the current user is a member of the group, or
  - the current user is a member of the project.
- Each user is assigned a maximum role.
- Members who have the **Project Invite** badge next to their profile on the usage quota page count towards the billable members of the shared project's top-level group.

## Maximum role

When you invite a group to a project, the maximum role is the highest level of access the invited group members are allowed to have in the project.

When multiple groups contain the same members, and the groups
have access to the same project, the group members are
given the highest access level of the two for the project.

The member's **Max role** is the more restrictive of:

- The role the user is assigned for the group.
- The role you chose when you invited the group to the project.

NOTE:
The Max role does not elevate the privileges of users.
For example, if a group member has the role of Developer, and the group is invited to a project with a Max role of Maintainer, the member's role is not elevated to Maintainer.

### Which roles you can assign

In GitLab [16.7](https://gitlab.com/gitlab-org/gitlab/-/issues/233408) and later, the maximum role you can assign depends on whether you have the Owner or Maintainer role for the project. The maximum role you can set is:

- Owner (`50`), if you have the Owner role for the project.
- Maintainer (`40`), if you have the Maintainer role for the project.

In GitLab 16.6 and earlier, the maximum role you can assign to an invited group is Maintainer (`40`).

### View the member's Max role

To view the maximum role assigned to a member:

1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Manage > Members**.
1. In the **Max role** column, view the user's maximum assigned role.

## View a group's shared projects

In a group, a shared project is a project to which the group members gained access through the [**Invite group**](#share-a-project-with-a-group) action.

To view a group's shared projects:

1. On the left sidebar, select **Search or go to** and find your group.
1. On the group page, select the **Shared projects** tab.

A list of shared projects is displayed.

## Related topics

- [Prevent a project from being shared with groups](../../group/access_and_permissions.md#prevent-a-project-from-being-shared-with-groups).
- [Prevent group sharing outside the group hierarchy](../../group/access_and_permissions.md#prevent-group-sharing-outside-the-group-hierarchy).