Module: Ibrain::UserMethods
- Extended by:
- ActiveSupport::Concern
- Includes:
- UserApiAuthentication
- Included in:
- LegacyUser
- Defined in:
- app/models/concerns/ibrain/user_methods.rb
Instance Method Summary collapse
Methods included from UserApiAuthentication
#clear_ibrain_api_key, #clear_ibrain_api_key!, #generate_ibrain_api_key, #generate_ibrain_api_key!
Instance Method Details
#auto_generate_ibrain_api_key ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/models/concerns/ibrain/user_methods.rb', line 15 def auto_generate_ibrain_api_key return if !respond_to?(:ibrain_api_key) || ibrain_api_key.present? if Ibrain::Config.generate_api_key_for_all_roles || (ibrain_roles.map(&:name) & Ibrain::Config.roles_for_auto_api_key).any? generate_ibrain_api_key! end end |