lib/doorkeeper-mongodb/mixins/mongoid/access_token_mixin.rb
# Checks whether the token scopes match the scopes from the parameters or
# Application scopes (if present).
#
# @param token_scopes [#to_s]
#   set of scopes (any object that responds to `#to_s`)
# @param param_scopes [Doorkeeper::OAuth::Scopes]
#   scopes from params
# @param app_scopes [Doorkeeper::OAuth::Scopes]
#   Application scopes
#
# @return [Boolean] true if the param scopes match the token scopes,
#   and all the param scopes are defined in the application (or in the
#   server configuration if the application doesn't define any scopes),
#   and false in other cases
#
Checks whether the token scopes match the scopes from the parameters or
Application scopes (if present).
Checks whether the token scopes match the scopes from the parameters or Application scopes ( if present ) .
def scopes_match?(token_scopes, param_scopes, app_scopes)
            return true if token_scopes.empty? && param_scopes.empty?
            (token_scopes.sort == param_scopes.sort) &&
              Doorkeeper::OAuth::Helpers::ScopeChecker.valid?(
                scope_str: param_scopes.to_s,
                server_scopes: Doorkeeper.configuration.scopes,
                app_scopes: app_scopes,
              )
          end
def scopes_match? ( token_scopes , param_scopes , app_scopes ) return true if token_scopes . empty? && param_scopes . empty? ( token_scopes . sort == param_scopes . sort ) && Doorkeeper :: OAuth :: Helpers :: ScopeChecker . valid? ( scope_str : param_scopes . to_s , server_scopes : Doorkeeper . configuration . scopes , app_scopes : app_scopes , ) end
Checks whether the token scopes match the scopes from the parameters or
Application scopes (if present).
Checks whether the token scopes match the scopes from the parameters or Application scopes ( if present ) .
true if the param scopes match the token scopes, and all the param scopes are defined in the application (or in the server configuration if the application doesn't define any scopes), and false in other cases
true if the param scopes match the token scopes and all the param scopes are defined in the application ( or in the server configuration if the application doesn ' t define any scopes ) and false in other cases
Boolean
token_scopes
set of scopes (any object that responds to `#to_s`)
set of scopes ( any object that responds to ` #to_s ` )
param_scopes
scopes from params
scopes from params
app_scopes
None