Class: EPC::Command::UpdateRoleCommand
- Inherits:
-
UpdateCommand
- Object
- BaseCommand
- UpdateCommand
- EPC::Command::UpdateRoleCommand
- Defined in:
- lib/epc/command/role/update_role_command.rb
Constant Summary
Constants inherited from BaseCommand
BaseCommand::GIVEUP_TICKS, BaseCommand::SLEEP_TIME, BaseCommand::TICKER_TICKS
Instance Attribute Summary
Attributes inherited from BaseCommand
#client, #klass_name, #object_id, #object_type, #options, #target_id, #target_type
Instance Method Summary collapse
Methods inherited from BaseCommand
#check_options, #context_params, #context_params=, #go, include_module, inherited, #initialize, required_options, #say_err
Methods included from PersistentAttributes
#auth_token, #caller_id, #target_url
Constructor Details
This class inherits a constructor from EPC::Command::BaseCommand
Instance Method Details
#execute(args = []) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/epc/command/role/update_role_command.rb', line 6 def execute(args = []) require_object role_id = object_id if [:file].present? data = EPC::Config.read_content_as_json([:file]) batch_add(object_id, data) end if [:add_user].present? status = add_user(role_id, [:add_user]) end if [:remove_user].present? status = remove_user(role_id, [:remove_user]) end if [:add_group].present? status = add_group(role_id, [:add_group]) end if [:remove_group].present? status = remove_group(role_id, [:remove_group]) end if [:add_grant].present? status = add_grant(role_id, [:add_grant]) end if [:remove_grant].present? status = remove_grant(role_id, [:remove_grant]) end return status end |