Class: MetumPolicy

Inherits:
ApplicationPolicy show all
Defined in:
app/policies/metum_policy.rb

Overview

Protects Metum objects

See Also:

Instance Method Summary collapse

Methods inherited from ApplicationPolicy

#initialize, #scope, #user

Constructor Details

This class inherits a constructor from ApplicationPolicy

Instance Method Details

#create?Boolean Also known as: new?, update?, edit?, destroy?

Returns only admins can create or edit meta

Returns:

  • (Boolean)

    only admins can create or edit meta



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

def create?
  user.admin?
end

#index?Boolean Also known as: show?

Returns all users can view meta

Returns:

  • (Boolean)

    all users can view meta



5
6
7
# File 'app/policies/metum_policy.rb', line 5

def index?
  true
end