Class: PageFilePolicy

Inherits:
Policy
  • Object
show all
Defined in:
app/policies/page_file_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

#edit?Boolean

Returns:

  • (Boolean)

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

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

#index?Boolean

Returns:

  • (Boolean)

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

def index?
  true
end

#new?Boolean

Returns:

  • (Boolean)

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

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

#reorder?Boolean

Returns:

  • (Boolean)

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

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

#show?Boolean

Returns:

  • (Boolean)

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

def show?
  true
end