Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions x-pack/plugins/security/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

export const GLOBAL_RESOURCE = '*';
export const IGNORED_TYPES = ['space'];
export const REALMS_ELIGIBLE_FOR_PASSWORD_CHANGE = ['reserved', 'native'];
7 changes: 7 additions & 0 deletions x-pack/plugins/security/public/views/account/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@
</div>

<!-- Change password -->
<div class="kuiFormSection" ng-if="!showChangePassword">
<label class="kuiFormLabel" i18n-id="xpack.security.account.passwordLabel" i18n-default-message="Password"></label>
<div class="euiText">
<p i18n-id="xpack.security.account.changePasswordNotSupportedText" i18n-default-message="You cannot change the password for this account."></p>
</div>
</div>
<kbn-change-password-form
ng-if="showChangePassword"
require-current-password="true"
show-kibana-warning="user.metadata._reserved && user.username === 'kibana'"
on-change-password="saveNewPassword(newPassword, currentPassword, onSuccess, onIncorrectPassword)"
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/security/public/views/account/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import template from './account.html';
import '../management/change_password_form/change_password_form';
import '../../services/shield_user';
import { i18n } from '@kbn/i18n';
import { REALMS_ELIGIBLE_FOR_PASSWORD_CHANGE } from '../../../common/constants';

routes.when('/account', {
template,
Expand All @@ -33,6 +34,9 @@ routes.when('/account', {

const notifier = new Notifier();

const { authentication_realm: authenticationRealm } = $scope.user;
$scope.showChangePassword = REALMS_ELIGIBLE_FOR_PASSWORD_CHANGE.includes(authenticationRealm.type);

$scope.saveNewPassword = (newPassword, currentPassword, onSuccess, onIncorrectPassword) => {
$scope.user.newPassword = newPassword;
if (currentPassword) {
Expand Down