lib/gooddata/models/profile.rb in gooddata-0.6.18 vs lib/gooddata/models/profile.rb in gooddata-0.6.19

- old
+ new

@@ -311,20 +311,21 @@ end end # Saves object if dirty, clears dirty flag def save! - if @dirty # rubocop:disable Style/GuardClause + if @dirty raw = @json.dup raw['accountSetting'].delete('login') if uri && !uri.empty? url = "/gdc/account/profile/#{obj_id}" @json = client.put url, raw @dirty = false end end + self end # Gets the preferred timezone # # @return [String] Preferred timezone @@ -377,9 +378,19 @@ end def sso_provider=(an_sso_provider) @dirty = true @json['accountSetting']['ssoProvider'] = an_sso_provider + end + + def authentication_modes + @json['accountSetting']['authenticationModes'].map { |x| x.downcase.to_sym } + end + + def authentication_modes=(modes) + modes = Array(modes) + @dirty = true + @json['accountSetting']['authenticationModes'] = modes.map { |x| x.to_s.upcase } end def to_hash tmp = content.merge(uri: uri).symbolize_keys [