Class: EventCategoryPolicy
- Inherits:
-
ApplicationPolicy
- Object
- ApplicationPolicy
- EventCategoryPolicy
- Defined in:
- app/policies/event_category_policy.rb
Instance Method Summary collapse
Instance Method Details
#create? ⇒ Boolean
10 11 12 |
# File 'app/policies/event_category_policy.rb', line 10 def create? user.try(:has_role?, 'Administrator') end |
#destroy? ⇒ Boolean
18 19 20 21 22 23 24 |
# File 'app/policies/event_category_policy.rb', line 18 def destroy? if user.try(:has_role?, 'Administrator') if record.events.empty? true if !['unknown', 'closed'].include?(record.name) end end end |
#index? ⇒ Boolean
2 3 4 |
# File 'app/policies/event_category_policy.rb', line 2 def index? true end |
#show? ⇒ Boolean
6 7 8 |
# File 'app/policies/event_category_policy.rb', line 6 def show? true end |
#update? ⇒ Boolean
14 15 16 |
# File 'app/policies/event_category_policy.rb', line 14 def update? user.try(:has_role?, 'Administrator') end |