Module: Doorkeeper::Orm::ActiveRecord::Mixins::Application::ClassMethods
- Defined in:
- lib/doorkeeper/orm/active_record/mixins/application.rb
Instance Method Summary collapse
-
#authorized_for(resource_owner) ⇒ ActiveRecord::Relation
Returns Applications associated with active (not revoked) Access Tokens that are owned by the specific Resource Owner.
-
#revoke_tokens_and_grants_for(id, resource_owner) ⇒ Object
Revokes AccessToken and AccessGrant records that have not been revoked and associated with the specific Application and Resource Owner.
Instance Method Details
#authorized_for(resource_owner) ⇒ ActiveRecord::Relation
Returns Applications associated with active (not revoked) Access Tokens that are owned by the specific Resource Owner.
192 193 194 195 |
# File 'lib/doorkeeper/orm/active_record/mixins/application.rb', line 192 def (resource_owner) resource_access_tokens = Doorkeeper.config.access_token_model.active_for(resource_owner) where(id: resource_access_tokens.select(:application_id).distinct) end |
#revoke_tokens_and_grants_for(id, resource_owner) ⇒ Object
Revokes AccessToken and AccessGrant records that have not been revoked and associated with the specific Application and Resource Owner.
203 204 205 206 |
# File 'lib/doorkeeper/orm/active_record/mixins/application.rb', line 203 def revoke_tokens_and_grants_for(id, resource_owner) Doorkeeper.config.access_token_model.revoke_all_for(id, resource_owner) Doorkeeper.config.access_grant_model.revoke_all_for(id, resource_owner) end |