Class: Central::Cli::Master::Users::RemoveRoleCommand
- Inherits:
-
Clamp::Command
- Object
- Clamp::Command
- Central::Cli::Master::Users::RemoveRoleCommand
- Includes:
- Common
- Defined in:
- lib/central/cli/master/users/remove_role_command.rb
Instance Method Summary collapse
Methods included from Common
#access_token=, #add_master, #api_url, #api_url=, #clear_current_stack, #client, #current_master, #current_master=, #current_master_index, #current_stack, #current_stack=, #ensure_custom_ssl_ca, #require_api_url, #require_current_stack, #require_token, #reset_client, #save_settings, #settings, #settings_filename
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/central/cli/master/users/remove_role_command.rb', line 10 def execute require_api_url token = require_token user_list.each do |email| begin response = client(token).delete("users/#{email}/roles/#{role}") puts "Removed role #{role} from #{email}" if response rescue => exec puts "Failed to remove role #{role} from #{email}".colorize(:red) puts exec. end end end |