Sha256: 0ce5d9f4690350491e986173c32b1c0f4ae20a082f7d57a699bb31279774bf90

Contents?: true

Size: 456 Bytes

Versions: 17

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  module Models
    module Scopes
      def scopes
        OAuth::Scopes.from_string(scopes_string)
      end

      def scopes=(value)
        super Array(value).join(" ")
      end

      def scopes_string
        self[:scopes]
      end

      def includes_scope?(*required_scopes)
        required_scopes.blank? || required_scopes.any? { |scope| scopes.exists?(scope.to_s) }
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
doorkeeper-5.1.2 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.2.6 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.3.3 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.1.1 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.2.5 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.3.2 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.2.4 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.3.1 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.3.0 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.2.3 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.2.2 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.2.1 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.2.0 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.2.0.rc3 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.2.0.rc2 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.2.0.rc1 lib/doorkeeper/models/concerns/scopes.rb
doorkeeper-5.1.0 lib/doorkeeper/models/concerns/scopes.rb