diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-23 18:08:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-23 18:08:46 +0300 |
commit | 3f9e1b261121f4dbd045341241f81b47356c99cf (patch) | |
tree | 32be23bd7fda0c3f891182f220f6d0399a1b41dd /doc/administration | |
parent | 5ad0cf26551baff8f08af8562a8d45e6ec14d71a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/administration')
-rw-r--r-- | doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index baadc2c6c56..c4b7324ce05 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -542,6 +542,20 @@ group = Group.find_by_full_path 'group' user.max_member_access_for_group group.id ``` +### Change user password + +```ruby +password = "your password" +user = User.find_by_username('your username') +password_attributes = { + password: password, + password_confirmation: password, + password_automatically_set: false +} + +result = Users::UpdateService.new(user, password_attributes.merge(user: user)).execute +``` + ## Groups ### Count unique users in a group and sub-groups |