Description of problem: When trying to update "admin" parameter of user-group with non-admin user change is accepted, but nothing happen. WebUI seems already prepared as when trying the same with non-admin user checkbox for Administrator is not visible How reproducible: Always Steps to Reproduce: 1. Create non-admin user with roles below view_filters, create_filters, edit_filters, destroy_filters view_usergroups, create_usergroups, edit_usergroups, destroy_usergroups view_roles, create_roles, edit_roles, destroy_roles view_external_usergroups, create_external_usergroups, edit_external_usergroup, destroy_external_usergroups view_bookmarks, create_bookmarks, edit_bookmarks, destroy_bookmarks attach_subscriptions, unattach_subscriptions escalate_roles view_organizations view_authenticators 2. Create new usergroup 3. Attempt to change "admin" parameter of user-group with hammer or API as below # hammer --config /root/.hammer/non_admin_user_config.yml user-group update --id 1 --admin 1 or # curl -X PUT -H "Content-Type: application/json" -u user:password -d '{"admin": '1'}' https://`hostname -f`/api/usergroups/1/ Actual results: hammer: User group [group] updated. API: {"admin":false,"created_at":"2020-06-16 14:10:11 UTC","updated_at":"2020-06-16 14:27:08 UTC","name":"group","id":1,"external_usergroups":[],"usergroups":[],"users":[],"roles":[]} Expected results: Not allowing operation with non-admin user and show warning message.
Hi, please see that there is no option --admin when updating a supergroup, the correct way to perform the command is as follows: ammer --username nonadmin --password XXX user-group update --name test --user-ids "4" please try again and see if it's working for you, and if not please attach hammer logs. thanks!
Hi, what you described is updating user-group with user-ids which is something completely different. This bug is about setting admin option to user-group which is totally a option as you can see below. # hammer shell Welcome to the hammer interactive shell. Type 'help' for usage information. hammer> user-group update --id 1 - --admin --id --location-id --name --organization --organization-title --roles --user-groups --users --help --location --location-title --new-name --organization-id --role-ids --user-group-ids --user-ids -h As you can see above --admin is an option in # hammer user-group, so please do not repeat me that "there is no option --admin" Additionally i also shared API request which is also finished with admin option, only when done with non-admin user nothing will change. I presume you mean hammer debug logs. [ INFO 2020-07-13T16:25:31 Init] Initialization of Hammer CLI (0.19.2.1) has started... [DEBUG 2020-07-13T16:25:31 Init] Running at ruby 2.5.5-p157 [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_core.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_katello.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_ansible.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_azure_rm.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_openscap.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_remote_execution.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_templates.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_virt_who_configure.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /root/.hammer/cli.modules.d/foreman.yml has been loaded [ INFO 2020-07-13T16:25:31 Init] Configuration from the file /root/.hammer/cli_config_consumerrights.yml has been loaded [DEBUG 2020-07-13T16:25:32 SSLoptions] SSL options: { :ssl_ca_file => "/etc/pki/katello/certs/katello-server-ca.crt", :verify_ssl => true } [DEBUG 2020-07-13T16:25:32 API] Global headers: { :content_type => "application/json", :accept => "application/json;version=2", "Accept-Language" => "en" } [DEBUG 2020-07-13T16:25:32 API] Follow redirects: never [DEBUG 2020-07-13T16:25:32 Connection] Registered: foreman [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::OptionSources] Added predefined options for HammerCLIForeman::Command: [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::OptionSources for *all* except *nothing* on HammerCLIForeman::Command. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::Fields] Added predefined options for HammerCLIForeman::ListCommand: [:fields] [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::Fields for *all* except *nothing* on HammerCLIForeman::ListCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::Fields] Added predefined options for HammerCLIForeman::InfoCommand: [:fields] [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::Fields for *all* except *nothing* on HammerCLIForeman::InfoCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::AssociatingCommands::PuppetEnvironment::AddPuppetEnvironmentCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::AssociatingCommands::PuppetEnvironment::AddPuppetEnvironmentCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Environment name", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --puppet-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::AssociatingCommands::PuppetEnvironment::AddPuppetEnvironmentCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000002ae6e40>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --puppet-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for *all* except *nothing* on HammerCLIForeman::AssociatingCommands::PuppetEnvironment::AddPuppetEnvironmentCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::AssociatingCommands::PuppetEnvironment::RemovePuppetEnvironmentCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::AssociatingCommands::PuppetEnvironment::RemovePuppetEnvironmentCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Environment name", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --puppet-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::AssociatingCommands::PuppetEnvironment::RemovePuppetEnvironmentCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000002ae6e40>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --puppet-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for *all* except *nothing* on HammerCLIForeman::AssociatingCommands::PuppetEnvironment::RemovePuppetEnvironmentCommand. [ INFO 2020-07-13T16:25:32 Modules] Extension module hammer_cli_foreman (0.19.6.4) loaded. [ INFO 2020-07-13T16:25:32 Modules] Extension module hammer_cli_foreman_admin (0.0.9) loaded. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::SmartClassParameter::ListCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::SmartClassParameter::ListCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Environment name", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --puppet-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::SmartClassParameter::ListCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000002ae6e40>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --puppet-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for *all* except *nothing* on HammerCLIForeman::SmartClassParameter::ListCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::PuppetClass::ListCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::PuppetClass::ListCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Environment name", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --puppet-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::PuppetClass::ListCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000002ae6e40>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --puppet-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for *all* except *nothing* on HammerCLIForeman::PuppetClass::ListCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::PuppetClass::InfoCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::PuppetClass::InfoCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Environment name", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --puppet-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::PuppetClass::InfoCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000002ae6e40>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --puppet-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for *all* except *nothing* on HammerCLIForeman::PuppetClass::InfoCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::Host::ListCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::Host::ListCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Environment name", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --puppet-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::Host::ListCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000002ae6e40>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --puppet-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for *all* except *nothing* on HammerCLIForeman::Host::ListCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::Host::CreateCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::Host::CreateCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Environment name", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --puppet-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::Host::CreateCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000002ae6e40>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --puppet-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for *all* except *nothing* on HammerCLIForeman::Host::CreateCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces] Added predefined options for HammerCLIForeman::Host::CreateCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces] Saved block for HammerCLIForeman::Host::CreateCommand help definition: #<Proc:0x0000000002adb478@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.19.6.4/lib/hammer_cli_foreman/command_extensions/hosts/help/interfaces.rb:6> [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces for *all* except *nothing* on HammerCLIForeman::Host::CreateCommand. [DEBUG 2020-07-13T16:25:32 #<Class:0x00000000039a08c8>] Added predefined options for HammerCLIForeman::Host::CreateCommand: [DEBUG 2020-07-13T16:25:32 #<Class:0x00000000039a08c8>] Saved block for HammerCLIForeman::Host::CreateCommand help definition: #<Proc:0x00000000039a07d8@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.19.6.4/lib/hammer_cli_foreman/command_extensions/hosts/help/compute_resources.rb:45> [ INFO 2020-07-13T16:25:32 Extensions] Applied #<Class:0x00000000039a08c8> for *all* except *nothing* on HammerCLIForeman::Host::CreateCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::Host::UpdateCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::Host::UpdateCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Environment name", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --puppet-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::Host::UpdateCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000002ae6e40>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --puppet-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for *all* except *nothing* on HammerCLIForeman::Host::UpdateCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces] Added predefined options for HammerCLIForeman::Host::UpdateCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces] Saved block for HammerCLIForeman::Host::UpdateCommand help definition: #<Proc:0x0000000002adb478@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.19.6.4/lib/hammer_cli_foreman/command_extensions/hosts/help/interfaces.rb:6> [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces for *all* except *nothing* on HammerCLIForeman::Host::UpdateCommand. [DEBUG 2020-07-13T16:25:32 #<Class:0x0000000003530298>] Added predefined options for HammerCLIForeman::Host::UpdateCommand: [DEBUG 2020-07-13T16:25:32 #<Class:0x0000000003530298>] Saved block for HammerCLIForeman::Host::UpdateCommand help definition: #<Proc:0x0000000003b17f80@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.19.6.4/lib/hammer_cli_foreman/command_extensions/hosts/help/compute_resources.rb:45> [ INFO 2020-07-13T16:25:32 Extensions] Applied #<Class:0x0000000003530298> for *all* except *nothing* on HammerCLIForeman::Host::UpdateCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::Hostgroup::CreateCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::Hostgroup::CreateCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Environment name", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --puppet-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::Hostgroup::CreateCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000002ae6e40>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --puppet-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for *all* except *nothing* on HammerCLIForeman::Hostgroup::CreateCommand. [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::Hostgroup::UpdateCommand: [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::Hostgroup::UpdateCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Environment name", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --puppet-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:32 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::Hostgroup::UpdateCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000002ae6e40>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --puppet-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:32 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for *all* except *nothing* on HammerCLIForeman::Hostgroup::UpdateCommand. [ INFO 2020-07-13T16:25:32 Modules] Extension module hammer_cli_foreman_ansible (0.3.2) loaded. [ INFO 2020-07-13T16:25:32 Modules] Extension module hammer_cli_foreman_bootdisk (0.3.0) loaded. [ INFO 2020-07-13T16:25:32 Modules] Extension module hammer_cli_foreman_discovery (1.0.2) loaded. [ INFO 2020-07-13T16:25:32 Modules] Extension module hammer_cli_foreman_openscap (0.1.8) loaded. [ INFO 2020-07-13T16:25:33 Modules] Extension module hammer_cli_foreman_templates (0.1.2) loaded. [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added predefined options for HammerCLIForeman::SmartProxy::ImportPuppetClassesCommand: [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::SmartProxy::ImportPuppetClassesCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Environment name", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --puppet-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::PuppetEnvironment] Added option for HammerCLIForeman::SmartProxy::ImportPuppetClassesCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000002ae6e40>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --puppet-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironment for *all* except *nothing* on HammerCLIForeman::SmartProxy::ImportPuppetClassesCommand. [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::Capsule::Content::AddLifecycleEnvironmentCommand: [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::AddLifecycleEnvironmentCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::AddLifecycleEnvironmentCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000003a3d4c0>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for *all* except *nothing* on HammerCLIKatello::Capsule::Content::AddLifecycleEnvironmentCommand. [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::Capsule::Content::RemoveLifecycleEnvironmentCommand: [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::RemoveLifecycleEnvironmentCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::RemoveLifecycleEnvironmentCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000003a3d4c0>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for *all* except *nothing* on HammerCLIKatello::Capsule::Content::RemoveLifecycleEnvironmentCommand. [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::Capsule::Content::SyncCommand: [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::SyncCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::Capsule::Content::SyncCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000003a3d4c0>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for *all* except *nothing* on HammerCLIKatello::Capsule::Content::SyncCommand. [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::PuppetEnvironments] Added predefined options for HammerCLIForeman::Organization::CreateCommand: [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::PuppetEnvironments] Added option for HammerCLIForeman::Organization::CreateCommand: {:switches=>"--environments", :type=>"ENVIRONMENT_NAMES", :description=>"", :opts=>{:attribute_name=>:option_environment_names, :deprecated=>{"--environments"=>"Use --puppet-environments instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::PuppetEnvironments] Added option for HammerCLIForeman::Organization::CreateCommand: {:switches=>"--environment-ids", :type=>"ENVIRONMENT_IDS", :description=>"Environment IDs", :opts=>{:format=>#<HammerCLI::Options::Normalizers::List:0x0000000002ae3da8>, :attribute_name=>:option_environment_ids, :deprecated=>{"--environment-ids"=>"Use --puppet-environment-ids instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironments for *all* except *nothing* on HammerCLIForeman::Organization::CreateCommand. [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::PuppetEnvironments] Added predefined options for HammerCLIForeman::Organization::UpdateCommand: [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::PuppetEnvironments] Added option for HammerCLIForeman::Organization::UpdateCommand: {:switches=>"--environments", :type=>"ENVIRONMENT_NAMES", :description=>"", :opts=>{:attribute_name=>:option_environment_names, :deprecated=>{"--environments"=>"Use --puppet-environments instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::PuppetEnvironments] Added option for HammerCLIForeman::Organization::UpdateCommand: {:switches=>"--environment-ids", :type=>"ENVIRONMENT_IDS", :description=>"Environment IDs", :opts=>{:format=>#<HammerCLI::Options::Normalizers::List:0x0000000002ae3da8>, :attribute_name=>:option_environment_ids, :deprecated=>{"--environment-ids"=>"Use --puppet-environment-ids instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIForeman::CommandExtensions::PuppetEnvironments for *all* except *nothing* on HammerCLIForeman::Organization::UpdateCommand. [ INFO 2020-07-13T16:25:33 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed. [ INFO 2020-07-13T16:25:33 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created. [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::HostErrata::ListCommand: [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::HostErrata::ListCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::HostErrata::ListCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000003a3d4c0>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for *all* except *nothing* on HammerCLIKatello::HostErrata::ListCommand. [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added predefined options for HammerCLIKatello::HostSubscription::CreateCommand: [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::HostSubscription::CreateCommand: {:switches=>"--environment", :type=>"ENVIRONMENT_NAME", :description=>"Lifecycle environment name to search by", :opts=>{:attribute_name=>:option_environment_name, :deprecated=>{"--environment"=>"Use --lifecycle-environment instead"}}, :block=>nil} [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::LifecycleEnvironment] Added option for HammerCLIKatello::HostSubscription::CreateCommand: {:switches=>"--environment-id", :type=>"ENVIRONMENT_ID", :description=>"", :opts=>{:format=>#<HammerCLI::Options::Normalizers::Number:0x0000000003a3d4c0>, :attribute_name=>:option_environment_id, :deprecated=>{"--environment-id"=>"Use --lifecycle-environment-id instead"}}, :block=>nil} [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIKatello::CommandExtensions::LifecycleEnvironment for *all* except *nothing* on HammerCLIKatello::HostSubscription::CreateCommand. [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::Ping] Added predefined options for HammerCLIForeman::PingCommand::ForemanCommand: [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIForeman::CommandExtensions::Ping for *all* except *nothing* on HammerCLIForeman::PingCommand::ForemanCommand. [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::Ping] Added predefined options for HammerCLIForeman::PingCommand::ForemanCommand: [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::Ping] Called block for HammerCLIForeman::PingCommand::ForemanCommand output definition: #<Proc:0x0000000003a383a8@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.20.2.3/lib/hammer_cli_katello/command_extensions/ping.rb:13> [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIKatello::CommandExtensions::Ping for *all* except *nothing* on HammerCLIForeman::PingCommand::ForemanCommand. [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIForeman::CommandExtensions::Ping for [:data] only on HammerCLIForeman::StatusCommand::ForemanCommand. [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIForeman::CommandExtensions::Status for [:data] only on HammerCLIForeman::StatusCommand::ForemanCommand. [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::Ping] Added predefined options for HammerCLIForeman::StatusCommand::ForemanCommand: [DEBUG 2020-07-13T16:25:33 HammerCLIKatello::CommandExtensions::Ping] Called block for HammerCLIForeman::StatusCommand::ForemanCommand output definition: #<Proc:0x0000000003a383a8@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.20.2.3/lib/hammer_cli_katello/command_extensions/ping.rb:13> [ INFO 2020-07-13T16:25:33 Extensions] Applied HammerCLIKatello::CommandExtensions::Ping for *all* except *nothing* on HammerCLIForeman::StatusCommand::ForemanCommand. [ INFO 2020-07-13T16:25:33 Modules] Extension module hammer_cli_katello (0.20.2.3) loaded. [DEBUG 2020-07-13T16:25:33 Init] Using locale 'en' [DEBUG 2020-07-13T16:25:33 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.19.2.1/locale' [DEBUG 2020-07-13T16:25:33 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.19.6.4/locale' [DEBUG 2020-07-13T16:25:33 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.6.4/locale' [DEBUG 2020-07-13T16:25:33 Init] 'mo' files for locale domain 'hammer-cli-foreman-virt-who-configure' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_virt_who_configure-0.0.5.1/locale' [DEBUG 2020-07-13T16:25:33 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.20.2.3/locale' [ INFO 2020-07-13T16:25:33 HammerCLI::MainCommand] Called with options: {"option_debug"=>true, "option_config"=>"/root/.hammer/cli_config_consumerrights.yml"} [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::OptionSources] Called block for HammerCLIForeman::Command option sources: #<Proc:0x0000000002ae1f08@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.19.6.4/lib/hammer_cli_foreman/command_extensions/option_sources.rb:6> [ INFO 2020-07-13T16:25:33 HammerCLIForeman::Usergroup] Called with options: {} [DEBUG 2020-07-13T16:25:33 HammerCLIForeman::CommandExtensions::OptionSources] Called block for HammerCLIForeman::Command option sources: #<Proc:0x0000000002ae1f08@/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.19.6.4/lib/hammer_cli_foreman/command_extensions/option_sources.rb:6> [ INFO 2020-07-13T16:25:33 HammerCLIForeman::Usergroup::UpdateCommand] Called with options: {"option_id"=>"1", "option_admin"=>true} [ INFO 2020-07-13T16:25:33 API] Server: https://jjansat67.usersys.redhat.com [ INFO 2020-07-13T16:25:33 API] PUT /api/usergroups/1 [DEBUG 2020-07-13T16:25:33 API] Params: { "usergroup" => { "admin" => true <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< } } [DEBUG 2020-07-13T16:25:33 API] Headers: {} [DEBUG 2020-07-13T16:25:33 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth [DEBUG 2020-07-13T16:25:34 API] Response: { "admin" => false, <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< "created_at" => "2020-06-16 14:10:11 UTC", "updated_at" => "2020-06-19 12:18:22 UTC", "name" => "test", "id" => 1, "external_usergroups" => [], "usergroups" => [], "users" => [], "roles" => [] } [DEBUG 2020-07-13T16:25:34 API] Response headers: { :date => "Mon, 13 Jul 2020 14:25:33 GMT", :server => "Apache", :foreman_version => "1.24.1.21", :foreman_api_version => "2", :foreman_current_organization => "; ANY", :foreman_current_location => "; ANY", :apipie_checksum => "defcd82e3ddda58c031f77377a1bb0f3e05236aa", :cache_control => "max-age=0, private, must-revalidate", :x_request_id => "58034b09-fbc9-4c76-9433-8e117086fba0", :x_runtime => "0.483070", :strict_transport_security => "max-age=631139040; includeSubdomains", :x_frame_options => "sameorigin", :x_content_type_options => "nosniff", :x_xss_protection => "1; mode=block", :x_download_options => "noopen", :x_permitted_cross_domain_policies => "none", :content_security_policy => "default-src 'self'; child-src 'self'; connect-src 'self' ws: wss:; img-src 'self' data: *.gravatar.com; script-src 'unsafe-eval' 'unsafe-inline' 'self'; style-src 'unsafe-inline' 'self'", :x_powered_by => "Phusion Passenger 4.0.18", :set_cookie => [ [0] "request_method=PUT; path=/; secure; HttpOnly; SameSite=Lax", [1] "_session_id=0fe20be28698feef2fd3ea9d676a6ebd; path=/; secure; HttpOnly; SameSite=Lax" ], :etag => "W/\"d7f6751f503d99c2a18d6437ca5a4fe0-gzip\"", :status => "200 OK", :vary => "Accept-Encoding", :content_encoding => "gzip", :content_length => "139", :content_type => "application/json; charset=utf-8" } User group [test] updated.
Created redmine issue https://projects.theforeman.org/issues/32213 from this bug
Upstream bug assigned to mhulan
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32213 has been resolved.
Steps to Test: 1. Deploy Satellite 6.10, snap 2. 2. Create a role with the following filters: ~~~ # hammer role filters --name not_admin ----|-----------------------|--------|------------|-----------|-----------|--------------------------------------------------------------------------------- ID | RESOURCE TYPE | SEARCH | UNLIMITED? | OVERRIDE? | ROLE | PERMISSIONS ----|-----------------------|--------|------------|-----------|-----------|--------------------------------------------------------------------------------- 460 | Filter | none | yes | no | not_admin | view_filters, create_filters, edit_filters, destroy_filters 461 | Usergroup | none | yes | no | not_admin | view_usergroups, create_usergroups, edit_usergroups, destroy_usergroups 463 | Role | none | yes | no | not_admin | view_roles, create_roles, edit_roles, destroy_roles 464 | ExternalUsergroup | none | yes | no | not_admin | view_external_usergroups, create_external_usergroups, edit_external_usergroup... 466 | Bookmark | none | yes | no | not_admin | view_bookmarks, create_bookmarks, edit_bookmarks, destroy_bookmarks 467 | Katello::Subscription | none | yes | no | not_admin | attach_subscriptions, unattach_subscriptions 468 | (Miscellaneous) | none | yes | no | not_admin | escalate_roles 469 | Organization | none | yes | no | not_admin | view_organizations 470 | AuthSource | none | yes | no | not_admin | view_authenticators ----|-----------------------|--------|------------|-----------|-----------|--------------------------------------------------------------------------------- ~~~ 3. Create a user that is not an admin and assign the above role. 4. Create a user group that does not have the admin setting enabled. 5. Attempt to change the admin setting on the user group from "false" to "true" and from "true" to "false" using both the non-admin user created above and the admin user. Expected Results: The non-admin user is unable to modify the admin setting on the user group and a descriptive error message is displayed. The admin user is able to modify the admin setting on the user group. Actual results: The non-admin user is unable to modify the admin setting on the user group and the following error message is displayed: ~~~ # curl -X PUT -H "Content-Type: application/json" -u non-admin_user:password -d {\"admin\":1} https://`hostname -f`/api/usergroups/1/ { "error": {"id":1,"errors":{"admin":["admin flag can only be modified by admins"]},"full_messages":["Administrator admin flag can only be modified by admins"]} } ~~~ The admin user is able to modify the admin setting on the user group: ~~~ # curl -X PUT -H "Content-Type: application/json" -u admin:password -d {\"admin\":1} https://`hostname -f`/api/usergroups/1/ {"admin":true,"created_at":"2021-06-01 18:49:27 UTC","updated_at":"2021-06-02 15:57:40 UTC","name":"not_admins","id":1,"external_usergroups":[],"usergroups":[],"users":[],"roles":[]} ~~~ Verified on Satellite 6.10, snap 2 (foreman-2.5.0-0.8.rc3.el7sat.noarch).
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: Satellite 6.10 Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:4702
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days