Class: SFRest::Centralized_role_management
- Inherits:
-
Object
- Object
- SFRest::Centralized_role_management
- Defined in:
- lib/sfrest/centralized_role_management.rb
Overview
We need to keep this naming due to the way connection.rb autoloads things. rubocop: disable Naming/ClassAndModuleCamelCase Manage the centralized role management feature.
Instance Method Summary collapse
-
#centralized_role_mapping ⇒ Array
Get current centralized role management settings.
-
#disable_role_mapping(factory_role) ⇒ Array
Disable the centralized role management settings for a given role.
-
#enable_role_mapping(factory_role, site_role = '') ⇒ Array
Enable the centralized role management settings for a given role.
-
#initialize(conn) ⇒ Centralized_role_management
constructor
A new instance of Centralized_role_management.
Constructor Details
#initialize(conn) ⇒ Centralized_role_management
Returns a new instance of Centralized_role_management.
11 12 13 |
# File 'lib/sfrest/centralized_role_management.rb', line 11 def initialize(conn) @conn = conn end |
Instance Method Details
#centralized_role_mapping ⇒ Array
Get current centralized role management settings
18 19 20 |
# File 'lib/sfrest/centralized_role_management.rb', line 18 def centralized_role_mapping @conn.get('/api/v1/centralized-role-management') end |
#disable_role_mapping(factory_role) ⇒ Array
Disable the centralized role management settings for a given role.
38 39 40 |
# File 'lib/sfrest/centralized_role_management.rb', line 38 def disable_role_mapping(factory_role) @conn.delete("/api/v1/centralized-role-management/#{factory_role}") end |
#enable_role_mapping(factory_role, site_role = '') ⇒ Array
Enable the centralized role management settings for a given role.
27 28 29 30 31 32 |
# File 'lib/sfrest/centralized_role_management.rb', line 27 def enable_role_mapping(factory_role, site_role = '') payload = { 'site_role' => site_role }.to_json @conn.put("/api/v1/centralized-role-management/#{factory_role}", payload) end |