Class: Proclaim::PostPolicy::Scope

Inherits:
Scope
  • Object
show all
Defined in:
app/policies/proclaim/post_policy.rb

Instance Method Summary collapse

Instance Method Details

#resolveObject



28
29
30
31
32
33
34
35
# File 'app/policies/proclaim/post_policy.rb', line 28

def resolve
	if @user
		scope.all # Users can access all posts
	else
		# Guests can see all posts that are published
		scope.published
	end
end