mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-21 20:15:10 +01:00
Add --remove-role
option to tootctl accounts modify
(#19477)
Fix #19152
This commit is contained in:
parent
3e18e05330
commit
d7595adbf4
@ -126,6 +126,7 @@ module Mastodon
|
|||||||
end
|
end
|
||||||
|
|
||||||
option :role
|
option :role
|
||||||
|
option :remove_role, type: :boolean
|
||||||
option :email
|
option :email
|
||||||
option :confirm, type: :boolean
|
option :confirm, type: :boolean
|
||||||
option :enable, type: :boolean
|
option :enable, type: :boolean
|
||||||
@ -137,7 +138,8 @@ module Mastodon
|
|||||||
long_desc <<-LONG_DESC
|
long_desc <<-LONG_DESC
|
||||||
Modify a user account.
|
Modify a user account.
|
||||||
|
|
||||||
With the --role option, update the user's role.
|
With the --role option, update the user's role. To remove the user's
|
||||||
|
role, i.e. demote to normal user, use --remove-role.
|
||||||
|
|
||||||
With the --email option, update the user's e-mail address. With
|
With the --email option, update the user's e-mail address. With
|
||||||
the --confirm option, mark the user's e-mail as confirmed.
|
the --confirm option, mark the user's e-mail as confirmed.
|
||||||
@ -171,6 +173,8 @@ module Mastodon
|
|||||||
end
|
end
|
||||||
|
|
||||||
user.role_id = role.id
|
user.role_id = role.id
|
||||||
|
elsif options[:remove_role]
|
||||||
|
user.role_id = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
password = SecureRandom.hex if options[:reset_password]
|
password = SecureRandom.hex if options[:reset_password]
|
||||||
|
Loading…
Reference in New Issue
Block a user