Class: Pageflow::EntryTemplatePolicy

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

Instance Method Summary collapse

Constructor Details

#initialize(user, entry_template) ⇒ EntryTemplatePolicy

Returns a new instance of EntryTemplatePolicy.



3
4
5
6
# File 'app/policies/pageflow/entry_template_policy.rb', line 3

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

Instance Method Details

#create?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'app/policies/pageflow/entry_template_policy.rb', line 8

def create?
  update?
end

#update?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/policies/pageflow/entry_template_policy.rb', line 12

def update?
  allows?(%w(publisher manager))
end