Class: Renalware::Modalities::DescriptionPolicy
- Inherits:
-
BasePolicy
- Object
- ApplicationPolicy
- BasePolicy
- Renalware::Modalities::DescriptionPolicy
- Defined in:
- app/policies/renalware/modalities/description_policy.rb
Instance Attribute Summary
Attributes inherited from ApplicationPolicy
Instance Method Summary collapse
-
#destroy? ⇒ Boolean
For safety we currently disallow the deletion of any ModalityDescription.
-
#edit? ⇒ Boolean
Its only possible to edit a ModalityDescription (e.g. to change its name) when it has no (STI) type - ie its not a system-required ModalityDescription.
- #update? ⇒ Boolean
Methods inherited from BasePolicy
#contact_added?, #create?, #debug?, #index?, #initialize, #show?, #sort?
Methods inherited from ApplicationPolicy
#create?, #index?, #initialize, #new?, #scope, #show?
Constructor Details
This class inherits a constructor from Renalware::BasePolicy
Instance Method Details
#destroy? ⇒ Boolean
For safety we currently disallow the deletion of any ModalityDescription
9 10 11 |
# File 'app/policies/renalware/modalities/description_policy.rb', line 9 def destroy? false end |
#edit? ⇒ Boolean
Its only possible to edit a ModalityDescription (e.g. to change its name) when it has no (STI) type - ie its not a system-required ModalityDescription.
15 16 17 |
# File 'app/policies/renalware/modalities/description_policy.rb', line 15 def edit? record.type.nil? end |
#update? ⇒ Boolean
19 20 21 |
# File 'app/policies/renalware/modalities/description_policy.rb', line 19 def update? edit? end |