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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
7bfc4f99
Commit
7bfc4f99
authored
Jun 13, 2019
by
Roger Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: do not apply setting "require 2FA" for ancestor group members
parent
35d928c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/models/group.rb
app/models/group.rb
+1
-1
changelogs/unreleased/feature-require-2fa-for-all-entities-in-group.yml
...eleased/feature-require-2fa-for-all-entities-in-group.yml
+1
-1
spec/models/group_spec.rb
spec/models/group_spec.rb
+2
-2
No files found.
app/models/group.rb
View file @
7bfc4f99
...
...
@@ -423,7 +423,7 @@ class Group < Namespace
def
update_two_factor_requirement
return
unless
saved_change_to_require_two_factor_authentication?
||
saved_change_to_two_factor_grace_period?
direct_and_indirect_member
s
.
find_each
(
&
:update_two_factor_requirement
)
members_with_descendant
s
.
find_each
(
&
:update_two_factor_requirement
)
end
def
path_changed_hook
...
...
changelogs/unreleased/feature-require-2fa-for-all-entities-in-group.yml
View file @
7bfc4f99
title
:
Apply the group setting "require 2FA" across all subgroup
and ancestor group
members as well when changing the group setting
title
:
Apply the group setting "require 2FA" across all subgroup members as well when changing the group setting
merge_request
:
24965
author
:
rroger
type
:
changed
spec/models/group_spec.rb
View file @
7bfc4f99
...
...
@@ -662,14 +662,14 @@ describe Group do
expect
(
indirect_user
.
reload
.
require_two_factor_authentication_from_group
).
to
be_truthy
end
it
'
enables
two_factor_requirement for ancestor group member'
do
it
'
does not enable
two_factor_requirement for ancestor group member'
do
ancestor_group
=
create
(
:group
)
ancestor_group
.
add_user
(
indirect_user
,
GroupMember
::
OWNER
)
group
.
update!
(
parent:
ancestor_group
)
group
.
update!
(
require_two_factor_authentication:
true
)
expect
(
indirect_user
.
reload
.
require_two_factor_authentication_from_group
).
to
be_
truth
y
expect
(
indirect_user
.
reload
.
require_two_factor_authentication_from_group
).
to
be_
false
y
end
end
...
...
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