Class: PostPolicy

Inherits:
ApplicationPolicy show all
Defined in:
app/policies/post_policy.rb

Overview

Post access policy

Defined Under Namespace

Classes: Scope

Instance Attribute Summary

Attributes inherited from ApplicationPolicy

#record, #user

Instance Method Summary collapse

Methods inherited from ApplicationPolicy

#create?, #destroy?, #edit?, #index?, #initialize, #new?, #scope, #show?

Constructor Details

This class inherits a constructor from ApplicationPolicy

Instance Method Details

#dashboard?Boolean

Returns:

  • (Boolean)

14
15
16
# File 'app/policies/post_policy.rb', line 14

def dashboard?
  update?
end

#update?Boolean

Returns:

  • (Boolean)

10
11
12
# File 'app/policies/post_policy.rb', line 10

def update?
  user.admin?
end