Class: Core::Models::OAuth::Scope

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/core/models/oauth/scope.rb

Overview

A scope gives access to some parts of the API, for example to the management of campaigns, applications or for account profile management.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#applicationsArray<Core::Models::OAuth::Application>

Returns the applications that want to have access to this scope from the users of the platform. These rights will be carried on to the tokens and frozen.

Returns:

  • (Array<Core::Models::OAuth::Application>)

    the applications that want to have access to this scope from the users of the platform. These rights will be carried on to the tokens and frozen.



20
# File 'lib/core/models/oauth/scope.rb', line 20

has_and_belongs_to_many :applications, class_name: 'Core::Models::OAuth::Application', inverse_of: :scopes

#nameString

Returns the name of the scope, used to get its translation on the frontend.

Returns:

  • (String)

    the name of the scope, used to get its translation on the frontend.



15
# File 'lib/core/models/oauth/scope.rb', line 15

field :name, type: String, default: ''

#tokeauthorizationsnsArray<Core::Models::OAuth::Authorization] the tokens having these scopes.

Returns Array<Core::Models::OAuth::Authorization] the tokens having these scopes.

Returns:



23
# File 'lib/core/models/oauth/scope.rb', line 23

has_and_belongs_to_many :authorizations, class_name: 'Core::Models::OAuth::Authorization', inverse_of: :scopes