Class: PagePolicy

Inherits:
Policy show all
Defined in:
app/policies/page_policy.rb

Instance Attribute Summary

Attributes inherited from Policy

#record, #user

Instance Method Summary collapse

Methods inherited from Policy

collection, for, #initialize, member

Methods included from Policy::DefaultPolicy

#create?, #destroy?, #index, #update?

Constructor Details

This class inherits a constructor from Policy

Instance Method Details

#calendar?Boolean

Returns:

  • (Boolean)


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

def calendar?
  index?
end

#delete_meta_image?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'app/policies/page_policy.rb', line 40

def delete_meta_image?
  edit?
end

#deleted?Boolean

Returns:

  • (Boolean)


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

def deleted?
  index?
end

#edit2?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'app/policies/page_policy.rb', line 32

def edit2?
  edit?
end

#edit?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/policies/page_policy.rb', line 28

def edit?
  user&.role?(:pages)
end

#index?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'app/policies/page_policy.rb', line 4

def index?
  true
end

#move?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'app/policies/page_policy.rb', line 36

def move?
  edit?
end

#new?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/policies/page_policy.rb', line 20

def new?
  user&.role?(:pages)
end

#search?Boolean

Returns:

  • (Boolean)


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

def search?
  index?
end

#show?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'app/policies/page_policy.rb', line 24

def show?
  true
end