Commit ecb69f22 authored by Peter Hegman's avatar Peter Hegman Committed by Paul Slaughter

Indicate locked users in Admin Area

Also document how to unlock a user from the Admin Area

Changelog: added
parent 3e98649b
...@@ -3,23 +3,26 @@ ...@@ -3,23 +3,26 @@
%h3.page-title.gl-m-0 %h3.page-title.gl-m-0
= @user.name = @user.name
- if @user.blocked_pending_approval? - if @user.blocked_pending_approval?
%span.cred %span.gl-text-red-500
= s_('AdminUsers|(Pending approval)') = s_('AdminUsers|(Pending approval)')
- elsif @user.banned? - elsif @user.banned?
%span.cred %span.gl-text-red-500
= s_('AdminUsers|(Banned)') = s_('AdminUsers|(Banned)')
- elsif @user.blocked? - elsif @user.blocked?
%span.cred %span.gl-text-red-500
= s_('AdminUsers|(Blocked)') = s_('AdminUsers|(Blocked)')
- if @user.internal? - if @user.internal?
%span.cred %span.gl-text-red-500
= s_('AdminUsers|(Internal)') = s_('AdminUsers|(Internal)')
- if @user.admin - if @user.admin
%span.cred %span.gl-text-red-500
= s_('AdminUsers|(Admin)') = s_('AdminUsers|(Admin)')
- if @user.deactivated? - if @user.deactivated?
%span.cred %span.gl-text-red-500
= s_('AdminUsers|(Deactivated)') = s_('AdminUsers|(Deactivated)')
- if @user.access_locked?
%span.gl-text-red-500
= s_('AdminUsers|(Locked)')
= render_if_exists 'admin/users/auditor_user_badge' = render_if_exists 'admin/users/auditor_user_badge'
= render_if_exists 'admin/users/gma_user_badge' = render_if_exists 'admin/users/gma_user_badge'
......
...@@ -5,9 +5,23 @@ info: To determine the technical writer assigned to the Stage/Group associated w ...@@ -5,9 +5,23 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type: howto type: howto
--- ---
# How to unlock a locked user from the command line **(FREE SELF)** # Locked users **(FREE SELF)**
After ten failed login attempts a user gets in a locked state. Users are locked after ten failed sign-in attempts. These users remain locked:
- For 10 minutes, after which time they are automatically unlocked.
- Until an admin unlocks them from the [Admin Area](../user/admin_area/index.md) or the command line in under 10 minutes.
## Unlock a user from the Admin Area
1. On the top bar, select **Menu > Admin**.
1. On the left sidebar, select **Overview > Users**.
1. Use the search bar to find the locked user.
1. From the **User administration** dropdown select **Unlock**.
![Unlock a user from the Admin Area](img/unlock_user_v14_7.png)
## Unlock a user from the command line
To unlock a locked user: To unlock a locked user:
......
...@@ -2645,6 +2645,9 @@ msgstr "" ...@@ -2645,6 +2645,9 @@ msgstr ""
msgid "AdminUsers|(Internal)" msgid "AdminUsers|(Internal)"
msgstr "" msgstr ""
msgid "AdminUsers|(Locked)"
msgstr ""
msgid "AdminUsers|(Pending approval)" msgid "AdminUsers|(Pending approval)"
msgstr "" msgstr ""
......
...@@ -125,6 +125,26 @@ RSpec.describe 'Admin::Users::User' do ...@@ -125,6 +125,26 @@ RSpec.describe 'Admin::Users::User' do
end end
end end
context 'when a user is locked', time_travel_to: '2020-02-02 10:30:45 -0700' do
let_it_be(:locked_user) { create(:user, locked_at: DateTime.parse('2020-02-02 10:30:00 -0700')) }
before do
visit admin_user_path(locked_user)
end
it "displays `(Locked)` next to user's name" do
expect(page).to have_content("#{locked_user.name} (Locked)")
end
it 'allows a user to be unlocked from the `User administration dropdown', :js do
accept_gl_confirm("Unlock user #{locked_user.name}?", button_text: 'Unlock') do
click_action_in_user_dropdown(locked_user.id, 'Unlock')
end
expect(page).not_to have_content("#{locked_user.name} (Locked)")
end
end
describe 'Impersonation' do describe 'Impersonation' do
let_it_be(:another_user) { create(:user) } let_it_be(:another_user) { create(:user) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment