summaryrefslogtreecommitdiff
path: root/app/controllers/groups
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-04-20 12:25:22 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-05-10 13:02:56 +0300
commit61e9a3dcc4d8d33ab2a5c2773acfce03db08a039 (patch)
treedd76390fdad5e0b3a97b97c3f083b3cc185dc0fd /app/controllers/groups
parent533593e95cd3a922a2ec2ea43b345862361dfd67 (diff)
downloadgitlab-ce-61e9a3dcc4d8d33ab2a5c2773acfce03db08a039.tar.gz
Add 2FA filter to group members page
* Show 2fa badge on a group members page * Make group members page UI consistent with project members page * Fix ambiguous sql in User.with/without_two_factor methods Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/groups')
-rw-r--r--app/controllers/groups/group_members_controller.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/groups/group_members_controller.rb b/app/controllers/groups/group_members_controller.rb
index 134b0dfc0db..ef3eba80154 100644
--- a/app/controllers/groups/group_members_controller.rb
+++ b/app/controllers/groups/group_members_controller.rb
@@ -11,13 +11,20 @@ class Groups::GroupMembersController < Groups::ApplicationController
:override
def index
+ can_manage_members = can?(current_user, :admin_group_member, @group)
+
@sort = params[:sort].presence || sort_value_name
@project = @group.projects.find(params[:project_id]) if params[:project_id]
@members = GroupMembersFinder.new(@group).execute
- @members = @members.non_invite unless can?(current_user, :admin_group, @group)
+ @members = @members.non_invite unless can_manage_members
@members = @members.search(params[:search]) if params[:search].present?
@members = @members.sort_by_attribute(@sort)
+
+ if can_manage_members && params[:two_factor].present?
+ @members = @members.filter_by_2fa(params[:two_factor])
+ end
+
@members = @members.page(params[:page]).per(50)
@members = present_members(@members.includes(:user))