Class: Teamlab::Settings
- Inherits:
-
Object
- Object
- Teamlab::Settings
- Defined in:
- lib/teamlab/modules/settings.rb
Constant Summary collapse
- GLOBAL_ADMIN_ID =
Returns id of global admin of portal.
'00000000-0000-0000-0000-000000000000'
Instance Method Summary collapse
- #get_admin_security(product_id, user_id) ⇒ Object
- #get_ip_restrictions ⇒ Object
- #get_ldap_settings ⇒ Object
- #get_logo ⇒ Object
- #get_product_admin(product_id) ⇒ Object
- #get_security(ids = []) ⇒ Object
- #get_settings ⇒ Object
- #get_sso_settings ⇒ Object
- #get_usage_quota ⇒ Object
- #get_version ⇒ Object
- #get_version_build ⇒ Object
- #get_white_label_sizes ⇒ Object
-
#initialize(config = nil) ⇒ Settings
constructor
A new instance of Settings.
- #save_ip_restrictions(ips) ⇒ Object
- #set_access(id, enabled = true) ⇒ Object
- #set_product_admin(product_id, user_id, administrator = true) ⇒ Object
- #set_security(id, options = {}) ⇒ Object
- #set_version(version_id) ⇒ Object
- #sms_settings(enable) ⇒ Object
- #update_default_portal_page(portal_page_id) ⇒ Object
- #update_ip_restrictions(enable) ⇒ Object
- #update_timezone_and_language(timezone, language) ⇒ Object
- #update_tips(show) ⇒ Object
Constructor Details
Instance Method Details
#get_admin_security(product_id, user_id) ⇒ Object
52 53 54 |
# File 'lib/teamlab/modules/settings.rb', line 52 def get_admin_security(product_id, user_id) @request.get(%w[security administrator], productid: product_id, userid: user_id) end |
#get_ip_restrictions ⇒ Object
44 45 46 |
# File 'lib/teamlab/modules/settings.rb', line 44 def get_ip_restrictions @request.get(%w[iprestrictions]) end |
#get_ldap_settings ⇒ Object
20 21 22 |
# File 'lib/teamlab/modules/settings.rb', line 20 def get_ldap_settings @request.get(%w[LDAP]) end |
#get_logo ⇒ Object
24 25 26 |
# File 'lib/teamlab/modules/settings.rb', line 24 def get_logo @request.get(%w[logo]) end |
#get_product_admin(product_id) ⇒ Object
56 57 58 |
# File 'lib/teamlab/modules/settings.rb', line 56 def get_product_admin(product_id) @request.get(['security', 'administrator', product_id.to_s]) end |
#get_security(ids = []) ⇒ Object
40 41 42 |
# File 'lib/teamlab/modules/settings.rb', line 40 def get_security(ids = []) @request.get(%w[security], ids: ids) end |
#get_settings ⇒ Object
12 13 14 |
# File 'lib/teamlab/modules/settings.rb', line 12 def get_settings @request.get end |
#get_sso_settings ⇒ Object
16 17 18 |
# File 'lib/teamlab/modules/settings.rb', line 16 def get_sso_settings @request.get(%w[ssov2]) end |
#get_usage_quota ⇒ Object
28 29 30 |
# File 'lib/teamlab/modules/settings.rb', line 28 def get_usage_quota @request.get(%w[quota]) end |
#get_version ⇒ Object
32 33 34 |
# File 'lib/teamlab/modules/settings.rb', line 32 def get_version @request.get(%w[version]) end |
#get_version_build ⇒ Object
36 37 38 |
# File 'lib/teamlab/modules/settings.rb', line 36 def get_version_build @request.get(%w[version build]) end |
#get_white_label_sizes ⇒ Object
48 49 50 |
# File 'lib/teamlab/modules/settings.rb', line 48 def get_white_label_sizes @request.get(%w[whitelabel sizes]) end |
#save_ip_restrictions(ips) ⇒ Object
76 77 78 |
# File 'lib/teamlab/modules/settings.rb', line 76 def save_ip_restrictions(ips) @request.put(%w[iprestrictions], ips: ips) end |
#set_access(id, enabled = true) ⇒ Object
80 81 82 |
# File 'lib/teamlab/modules/settings.rb', line 80 def set_access(id, enabled = true) @request.put(%w[security access], items: [{ key: id, value: enabled }]) end |
#set_product_admin(product_id, user_id, administrator = true) ⇒ Object
84 85 86 |
# File 'lib/teamlab/modules/settings.rb', line 84 def set_product_admin(product_id, user_id, administrator = true) @request.put(%w[security administrator], productid: product_id, userid: user_id, administrator: administrator) end |
#set_security(id, options = {}) ⇒ Object
72 73 74 |
# File 'lib/teamlab/modules/settings.rb', line 72 def set_security(id, = {}) @request.put(%w[security], { id: id }.merge()) end |
#set_version(version_id) ⇒ Object
68 69 70 |
# File 'lib/teamlab/modules/settings.rb', line 68 def set_version(version_id) @request.put(%w[version], versionId: version_id) end |
#sms_settings(enable) ⇒ Object
60 61 62 |
# File 'lib/teamlab/modules/settings.rb', line 60 def sms_settings(enable) @request.put(%w[sms], enable: enable) end |
#update_default_portal_page(portal_page_id) ⇒ Object
96 97 98 |
# File 'lib/teamlab/modules/settings.rb', line 96 def update_default_portal_page(portal_page_id) @request.put(%w[defaultpage], defaultProductID: portal_page_id) end |
#update_ip_restrictions(enable) ⇒ Object
88 89 90 |
# File 'lib/teamlab/modules/settings.rb', line 88 def update_ip_restrictions(enable) @request.put(%w[iprestrictions settings], enable: enable) end |
#update_timezone_and_language(timezone, language) ⇒ Object
92 93 94 |
# File 'lib/teamlab/modules/settings.rb', line 92 def update_timezone_and_language(timezone, language) @request.put(%w[timeandlanguage], lng: language, timeZoneId: timezone) end |
#update_tips(show) ⇒ Object
64 65 66 |
# File 'lib/teamlab/modules/settings.rb', line 64 def update_tips(show) @request.put(%w[tips], show: show) end |