Class: Landable::AccessToken
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Landable::AccessToken
- Includes:
- TableName
- Defined in:
- app/models/landable/access_token.rb
Constant Summary collapse
- MAX_AGE =
Maximum token age, in hours
((Landable.configuration['ldap'] && Landable.configuration['ldap'][:access_token_max_age]) || 8).hours
Instance Method Summary collapse
Instance Method Details
#can_edit? ⇒ Boolean
29 30 31 |
# File 'app/models/landable/access_token.rb', line 29 def can_edit? ['edit'] == 'true' end |
#can_publish? ⇒ Boolean
25 26 27 |
# File 'app/models/landable/access_token.rb', line 25 def can_publish? ['publish'] == 'true' end |
#can_read? ⇒ Boolean
33 34 35 |
# File 'app/models/landable/access_token.rb', line 33 def can_read? ['read'] == 'true' end |
#refresh! ⇒ Object
21 22 23 |
# File 'app/models/landable/access_token.rb', line 21 def refresh! update_column :expires_at, expiration end |