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
1ffd2cb0
Commit
1ffd2cb0
authored
May 03, 2021
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename method based on cr comment
parent
064095cf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
ee/app/controllers/concerns/ee/membership_actions.rb
ee/app/controllers/concerns/ee/membership_actions.rb
+1
-1
ee/app/controllers/groups/sso_controller.rb
ee/app/controllers/groups/sso_controller.rb
+1
-1
ee/app/models/ee/user.rb
ee/app/models/ee/user.rb
+10
-6
ee/lib/gitlab/auth/group_saml/user.rb
ee/lib/gitlab/auth/group_saml/user.rb
+2
-2
No files found.
ee/app/controllers/concerns/ee/membership_actions.rb
View file @
1ffd2cb0
...
...
@@ -8,7 +8,7 @@ module EE
def
leave
super
if
current_user
.
authorized_by_provisioning_group?
&&
membershipable
==
current_user
.
provisioned_by_group
if
current_user
.
authorized_by_provisioning_group?
(
membershipable
)
sign_out
current_user
end
end
...
...
ee/app/controllers/groups/sso_controller.rb
View file @
1ffd2cb0
...
...
@@ -33,7 +33,7 @@ class Groups::SsoController < Groups::ApplicationController
GroupSaml
::
Identity
::
DestroyService
.
new
(
linked_identity
).
execute
if
current_user
.
authorized_by_provisioning_group?
&&
unauthenticated_group
==
current_user
.
provisioned_by_group
if
current_user
.
authorized_by_provisioning_group?
(
unauthenticated_group
)
sign_out
current_user
else
redirect_to
profile_account_path
...
...
ee/app/models/ee/user.rb
View file @
1ffd2cb0
...
...
@@ -298,10 +298,6 @@ module EE
managing_group
.
present?
end
def
authorized_by_provisioning_group?
::
Feature
.
enabled?
(
:block_password_auth_for_saml_users
,
type: :ops
)
&&
user_detail
.
provisioned_by_group?
end
def
managed_by?
(
user
)
self
.
group_managed_account?
&&
self
.
managing_group
.
owned_by?
(
user
)
end
...
...
@@ -318,7 +314,7 @@ module EE
override
:allow_password_authentication_for_web?
def
allow_password_authentication_for_web?
(
*
)
return
false
if
group_managed_account?
return
false
if
authorized_by_provisioning_group?
return
false
if
user_
authorized_by_provisioning_group?
super
end
...
...
@@ -326,11 +322,19 @@ module EE
override
:allow_password_authentication_for_git?
def
allow_password_authentication_for_git?
(
*
)
return
false
if
group_managed_account?
return
false
if
authorized_by_provisioning_group?
return
false
if
user_
authorized_by_provisioning_group?
super
end
def
user_authorized_by_provisioning_group?
::
Feature
.
enabled?
(
:block_password_auth_for_saml_users
,
type: :ops
)
&&
user_detail
.
provisioned_by_group?
end
def
authorized_by_provisioning_group?
(
group
)
::
Feature
.
enabled?
(
:block_password_auth_for_saml_users
,
type: :ops
)
&&
provisioned_by_group
==
group
end
def
gitlab_employee?
strong_memoize
(
:gitlab_employee
)
do
::
Gitlab
.
com?
&&
::
Feature
.
enabled?
(
:gitlab_employee_badge
)
&&
gitlab_team_member?
...
...
ee/lib/gitlab/auth/group_saml/user.rb
View file @
1ffd2cb0
...
...
@@ -52,9 +52,9 @@ module Gitlab
def
find_by_email
user
=
super
return
user
if
user
&
.
authorized_by_provisioning_group?
&&
user
&
.
provisioned_by_group_id
==
saml_provider
.
group_id
return
user
if
user
&
.
authorized_by_provisioning_group?
(
saml_provider
.
group
)
false
nil
end
override
:build_new_user
...
...
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