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)


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

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

#index?Boolean

Returns:

  • (Boolean)


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

def index?
  true
end

#new?Boolean

Returns:

  • (Boolean)


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

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

#reorder?Boolean

Returns:

  • (Boolean)


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

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

#show?Boolean

Returns:

  • (Boolean)


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

def show?
  true
end