Class: UffizziCore::ApplicationPolicy

Inherits:
Object
  • Object
show all
Defined in:
app/policies/uffizzi_core/application_policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, record) ⇒ ApplicationPolicy

Returns a new instance of ApplicationPolicy.

Raises:

  • (Pundit::NotAuthorizedError)


6
7
8
9
10
11
# File 'app/policies/uffizzi_core/application_policy.rb', line 6

def initialize(context, record)
  raise Pundit::NotAuthorizedError, 'must be logged in' if !context.instance_of?(UffizziCore::WebhooksContext) && context.user.blank?

  @record = record
  @context = context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



4
5
6
# File 'app/policies/uffizzi_core/application_policy.rb', line 4

def context
  @context
end

#recordObject (readonly)

Returns the value of attribute record.



4
5
6
# File 'app/policies/uffizzi_core/application_policy.rb', line 4

def record
  @record
end