Class: MetumPolicy
- Inherits:
-
ApplicationPolicy
- Object
- ApplicationPolicy
- MetumPolicy
- Defined in:
- app/policies/metum_policy.rb
Overview
Protects Metum objects
Instance Method Summary collapse
-
#create? ⇒ Boolean
(also: #new?, #update?, #edit?, #destroy?)
Only admins can create or edit meta.
-
#index? ⇒ Boolean
(also: #show?)
All users can view meta.
Methods inherited from ApplicationPolicy
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
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
5 6 7 |
# File 'app/policies/metum_policy.rb', line 5 def index? true end |