summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/projects/settings/access_dropdown.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-08 09:17:44 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-08 09:17:44 +0000
commitefe3186770a4218333e1a720f1e4d3794892673e (patch)
treeb637f816536c38ac920373aeb5c58b1540f8d921 /app/assets/javascripts/projects/settings/access_dropdown.js
parent6eed20a9c4ecc6ad0ce1615c9922eb615db7a45f (diff)
downloadgitlab-ce-efe3186770a4218333e1a720f1e4d3794892673e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/projects/settings/access_dropdown.js')
-rw-r--r--app/assets/javascripts/projects/settings/access_dropdown.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/app/assets/javascripts/projects/settings/access_dropdown.js b/app/assets/javascripts/projects/settings/access_dropdown.js
index 71c9e580420..d8675a851ea 100644
--- a/app/assets/javascripts/projects/settings/access_dropdown.js
+++ b/app/assets/javascripts/projects/settings/access_dropdown.js
@@ -408,14 +408,16 @@ export default class AccessDropdown {
// Has to be checked against server response
// because the selected item can be in filter results
- usersResponse.forEach((response) => {
- // Add is it has not been added
- if (map.indexOf(LEVEL_TYPES.USER + response.id) === -1) {
- const user = { ...response };
- user.type = LEVEL_TYPES.USER;
- users.push(user);
- }
- });
+ if (gon.current_project_id) {
+ usersResponse.forEach((response) => {
+ // Add is it has not been added
+ if (map.indexOf(LEVEL_TYPES.USER + response.id) === -1) {
+ const user = { ...response };
+ user.type = LEVEL_TYPES.USER;
+ users.push(user);
+ }
+ });
+ }
if (groups.length) {
if (roles.length) {