Class: GoogleOauth2HdGroupsValidator
- Inherits:
-
Object
- Object
- GoogleOauth2HdGroupsValidator
- Defined in:
- lib/validators/google_oauth2_hd_groups_validator.rb
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(opts = {}) ⇒ GoogleOauth2HdGroupsValidator
constructor
A new instance of GoogleOauth2HdGroupsValidator.
- #valid_value?(value) ⇒ Boolean
Constructor Details
#initialize(opts = {}) ⇒ GoogleOauth2HdGroupsValidator
Returns a new instance of GoogleOauth2HdGroupsValidator.
4 5 6 |
# File 'lib/validators/google_oauth2_hd_groups_validator.rb', line 4 def initialize(opts = {}) @opts = opts end |
Instance Method Details
#error_message ⇒ Object
18 19 20 |
# File 'lib/validators/google_oauth2_hd_groups_validator.rb', line 18 def I18n.t("site_settings.errors.google_oauth2_hd_groups") if !@valid end |
#valid_value?(value) ⇒ Boolean
8 9 10 11 12 13 14 15 16 |
# File 'lib/validators/google_oauth2_hd_groups_validator.rb', line 8 def valid_value?(value) @valid = value == "f" || ( SiteSetting.google_oauth2_hd.present? && SiteSetting.google_oauth2_hd_groups_service_account_admin_email.present? && SiteSetting.google_oauth2_hd_groups_service_account_json.present? ) end |