Class: ApplicationPolicy

Inherits:
Struct
  • Object
show all
Defined in:
app/policies/application_policy.rb

Overview

Default admin-only authorization policy.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#resourceObject

Returns the value of attribute resource



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

def resource
  @resource
end

#userObject

Returns the value of attribute user



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

def user
  @user
end

Instance Method Details

#create?Boolean Also known as: new?



3
4
5
# File 'app/policies/application_policy.rb', line 3

def create?
  admin?
end

#destroy?Boolean



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

def destroy?
  admin?
end

#show?Boolean Also known as: index?



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

def show?
  admin?
end

#update?Boolean Also known as: edit?



17
18
19
# File 'app/policies/application_policy.rb', line 17

def update?
  admin?
end