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
28782d51
Commit
28782d51
authored
Feb 07, 2019
by
Roger Rüttimann
Committed by
Roger Meier
Jun 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove experiments for 2fa requirements and fix tests
parent
dfe5ffd4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
app/models/group.rb
app/models/group.rb
+1
-1
app/models/user.rb
app/models/user.rb
+2
-2
spec/models/group_spec.rb
spec/models/group_spec.rb
+5
-1
No files found.
app/models/group.rb
View file @
28782d51
...
@@ -423,7 +423,7 @@ class Group < Namespace
...
@@ -423,7 +423,7 @@ class Group < Namespace
def
update_two_factor_requirement
def
update_two_factor_requirement
return
unless
saved_change_to_require_two_factor_authentication?
||
saved_change_to_two_factor_grace_period?
return
unless
saved_change_to_require_two_factor_authentication?
||
saved_change_to_two_factor_grace_period?
[
users_with_descendants
,
project_users_with_descendants
].
each
{
|
set
|
set
.
find_each
(
&
:update_two_factor_requirement
)}
User
.
from_union
([
users_with_descendants
,
project_users_with_descendants
]).
find_each
(
&
:update_two_factor_requirement
)
end
end
def
path_changed_hook
def
path_changed_hook
...
...
app/models/user.rb
View file @
28782d51
...
@@ -728,8 +728,8 @@ class User < ApplicationRecord
...
@@ -728,8 +728,8 @@ class User < ApplicationRecord
end
end
def
expanded_groups_requiring_two_factor_authentication
def
expanded_groups_requiring_two_factor_authentication
all_expanded_groups
.
where
(
require_two_factor_authentication:
true
).
merge
(
Group
.
from_union
([
all_expanded_groups
.
where
(
require_two_factor_authentication:
true
),
authorized_groups
.
where
(
require_two_factor_authentication:
true
)
)
authorized_groups
.
where
(
require_two_factor_authentication:
true
)]
)
end
end
# rubocop: disable CodeReuse/ServiceClass
# rubocop: disable CodeReuse/ServiceClass
...
...
spec/models/group_spec.rb
View file @
28782d51
...
@@ -633,7 +633,11 @@ describe Group do
...
@@ -633,7 +633,11 @@ describe Group do
group
.
update!
(
require_two_factor_authentication:
true
,
two_factor_grace_period:
23
)
group
.
update!
(
require_two_factor_authentication:
true
,
two_factor_grace_period:
23
)
if
Group
.
supports_nested_objects?
expect
(
calls
).
to
eq
2
expect
(
calls
).
to
eq
2
else
expect
(
calls
).
to
eq
1
end
end
end
it
'calls #update_two_factor_requirement on each group member'
do
it
'calls #update_two_factor_requirement on each group member'
do
...
...
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