Module: AccessionHelper
- Included in:
- Accession::SampleAccessioning, SampleManifestExcel::Upload::Base, SamplesController, StudiesController
- Defined in:
- app/helpers/accession_helper.rb
Overview
Helper methods to determine accessionablity and permissions at application level.
See Study#samples_accessionable? for study level. See Sample#should_be_accessioned? for sample level.
Instance Method Summary collapse
-
#accessioning_enabled? ⇒ Boolean
Checks if accessioning is enabled in this environment.
-
#permitted_to_accession?(object) ⇒ Boolean
Checks if the current user is permitted to accession the given object.
Instance Method Details
#accessioning_enabled? ⇒ Boolean
Checks if accessioning is enabled in this environment. This is controlled by a a feature flag
11 12 13 |
# File 'app/helpers/accession_helper.rb', line 11 def accessioning_enabled? Flipper.enabled?(:y25_706_enable_accessioning) end |
#permitted_to_accession?(object) ⇒ Boolean
Checks if the current user is permitted to accession the given object.
18 19 20 |
# File 'app/helpers/accession_helper.rb', line 18 def permitted_to_accession?(object) can?(:accession, object) || false end |