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

#delete_meta_image?Boolean

Returns:

  • (Boolean)

34
35
36
# File 'app/policies/page_policy.rb', line 34

def delete_meta_image?
  edit?
end

#deleted?Boolean

Returns:

  • (Boolean)

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

def deleted?
  index?
end

#edit?Boolean

Returns:

  • (Boolean)

26
27
28
# File 'app/policies/page_policy.rb', line 26

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

#index?Boolean

Returns:

  • (Boolean)

2
3
4
# File 'app/policies/page_policy.rb', line 2

def index?
  true
end

#move?Boolean

Returns:

  • (Boolean)

30
31
32
# File 'app/policies/page_policy.rb', line 30

def move?
  edit?
end

#new?Boolean

Returns:

  • (Boolean)

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

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

#new_news?Boolean

Returns:

  • (Boolean)

18
19
20
# File 'app/policies/page_policy.rb', line 18

def new_news?
  create?
end

#news?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'app/policies/page_policy.rb', line 6

def news?
  true
end

#show?Boolean

Returns:

  • (Boolean)

22
23
24
# File 'app/policies/page_policy.rb', line 22

def show?
  true
end