Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a2f2658b
Commit
a2f2658b
authored
Apr 17, 2020
by
Gosia Ksionek
Committed by
Stan Hu
Apr 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Error 500 when inviting user to a few projects
parent
3e5a1f48
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
changelogs/unreleased/214691-error-500-when-inviting-user-to-a-few-projects.yml
...214691-error-500-when-inviting-user-to-a-few-projects.yml
+5
-0
ee/lib/gitlab/auth/group_saml/gma_membership_enforcer.rb
ee/lib/gitlab/auth/group_saml/gma_membership_enforcer.rb
+1
-0
ee/spec/lib/gitlab/auth/group_saml/gma_membership_enforcer_spec.rb
...ib/gitlab/auth/group_saml/gma_membership_enforcer_spec.rb
+23
-0
No files found.
changelogs/unreleased/214691-error-500-when-inviting-user-to-a-few-projects.yml
0 → 100644
View file @
a2f2658b
---
title
:
Fix Error 500 when inviting user to a few projects
merge_request
:
29778
author
:
type
:
fixed
ee/lib/gitlab/auth/group_saml/gma_membership_enforcer.rb
View file @
a2f2658b
...
...
@@ -22,6 +22,7 @@ module Gitlab
def
check_source_project_membership
(
user
)
return
true
unless
project
.
forked?
return
true
unless
project
.
forked_from_project
check_group_managed_account
(
project
.
forked_from_project
.
root_ancestor
,
user
)
end
...
...
ee/spec/lib/gitlab/auth/group_saml/gma_membership_enforcer_spec.rb
View file @
a2f2658b
...
...
@@ -50,6 +50,29 @@ describe Gitlab::Auth::GroupSaml::GmaMembershipEnforcer do
end
end
context
'when the project is forked from deleted project'
do
let!
(
:forked_project
)
{
fork_project
(
project
,
managed_user_for_project
)
}
before
do
project
.
add_developer
(
managed_user_for_project
)
project
.
delete
end
context
'when user is group-managed'
do
it
'allows adding user to project'
do
subject
=
described_class
.
new
(
forked_project
)
expect
(
subject
.
can_add_user?
(
managed_user
)).
to
be_truthy
end
end
context
'when user is not group-managed'
do
it
'does not allow adding user to project'
do
subject
=
described_class
.
new
(
forked_project
)
expect
(
subject
.
can_add_user?
(
create
(
:user
))).
to
be_truthy
end
end
end
context
'when project is forked from namespace to group'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:forked_project
)
{
create
(
:project
,
namespace:
group
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment