Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I make an existing user an admin #1096

Closed
JimZipCode opened this issue Dec 2, 2022 · 3 comments
Closed

How do I make an existing user an admin #1096

JimZipCode opened this issue Dec 2, 2022 · 3 comments

Comments

@JimZipCode
Copy link

JimZipCode commented Dec 2, 2022

I'm running Mastodon 4.0.2

  1. Can this only be done from the command line?

If so, WHY on earth? Don't we want most routine user-management tasks done from the UI?

  1. How to do it from command line?

This does not work:

root@mastodon:~# su - mastodon
mastodon@mastodon:~$ RAILS_ENV=production bundle exec rails mastodon:make_admin USERNAME=JimZipCode
Could not locate Gemfile or .bundle/ directory
mastodon@mastodon:~$ cd live
mastodon@mastodon:~/live$ RAILS_ENV=production bundle exec rails mastodon:make_admin USERNAME=MyUser
rails aborted!
Don't know how to build task 'mastodon:make_admin' (See the list of available tasks with `rails --tasks`)
Did you mean?  mastodon:stats
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task_manager.rb:59:in `[]'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:159:in `invoke_task'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/railties-6.1.7/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/railties-6.1.7/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/railties-6.1.7/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/railties-6.1.7/lib/rails/command.rb:50:in `invoke'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/railties-6.1.7/lib/rails/commands.rb:18:in `<top (required)>'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/home/mastodon/live/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
(See full trace by running task with --trace)

I'll attach the out from the rails --tasks command.
tasks_output.txt

This also does not work:

mastodon@mastodon:~/live$ RAILS_ENV=production bin/tootctl accounts modify MyUser --role admin
Cannot find user role with that name

That error message makes a sort of sense. Admin is not a custom or user-defined role, it is a default role. But then how do I put someone into it?

@trwnh
Copy link
Member

trwnh commented Dec 7, 2022

4.0+ roles are case-sensitive

@JimZipCode
Copy link
Author

Thanks. So what do I change my attempted-commands to?

@trwnh
Copy link
Member

trwnh commented Dec 8, 2022

change --role admin to --role Admin i think

@vmstan vmstan closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants