Class: Trax::Controller::Authorization::Pundit::BasePolicy

Inherits:
Object
  • Object
show all
Defined in:
lib/trax/controller/authorization/pundit/base_policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, resource) ⇒ BasePolicy

Result is set to true by default because it makes chaining easy with &&=



9
10
11
12
13
# File 'lib/trax/controller/authorization/pundit/base_policy.rb', line 9

def initialize(user, resource)
  @user = user
  @resource = resource
  @result = true
end

Instance Attribute Details

#resourceObject

Returns the value of attribute resource.



6
7
8
# File 'lib/trax/controller/authorization/pundit/base_policy.rb', line 6

def resource
  @resource
end

#resultObject

Returns the value of attribute result.



6
7
8
# File 'lib/trax/controller/authorization/pundit/base_policy.rb', line 6

def result
  @result
end

#userObject

Returns the value of attribute user.



6
7
8
# File 'lib/trax/controller/authorization/pundit/base_policy.rb', line 6

def user
  @user
end