Class: Thredded::PrivatePostPolicy::Scope

Inherits:
Object
  • Object
show all
Defined in:
app/policies/thredded/private_post_policy.rb

Overview

The scope of readable private posts. Thredded::PrivateTopicPolicy must be applied separately.

Instance Method Summary collapse

Constructor Details

#initialize(user, scope) ⇒ Scope

Returns a new instance of Scope.

Parameters:



10
11
12
13
# File 'app/policies/thredded/private_post_policy.rb', line 10

def initialize(user, scope)
  @user = user
  @scope = scope
end

Instance Method Details

#resolveActiveRecord::Relation<Thredded::Post>

Returns:



16
17
18
# File 'app/policies/thredded/private_post_policy.rb', line 16

def resolve
  @scope
end