Module: Hyrax::PermissionLevelsHelper

Included in:
HyraxHelperBehavior
Defined in:
app/helpers/hyrax/permission_levels_helper.rb

Instance Method Summary collapse

Instance Method Details

#configured_owner_permission_levelsHash<String, String>

Returns a map from i18nized strings to permission level keywords.

Returns:

  • (Hash<String, String>)

    a map from i18nized strings to permission level keywords


17
18
19
20
21
# File 'app/helpers/hyrax/permission_levels_helper.rb', line 17

def configured_owner_permission_levels
  Hyrax.config.owner_permission_levels.values.index_by do |level|
    I18n.t("hyrax.permission_levels.owner.#{level}")
  end
end

#configured_permission_levelsHash<String, String>

Returns a map from i18nized strings to permission level keywords.

Returns:

  • (Hash<String, String>)

    a map from i18nized strings to permission level keywords


8
9
10
11
12
# File 'app/helpers/hyrax/permission_levels_helper.rb', line 8

def configured_permission_levels
  Hyrax.config.permission_levels.values.index_by do |level|
    I18n.t("hyrax.permission_levels.#{level}")
  end
end

#configured_permission_optionsHash<String, String>

Returns a map from i18nized strings to permission level keywords.

Returns:

  • (Hash<String, String>)

    a map from i18nized strings to permission level keywords


26
27
28
29
30
# File 'app/helpers/hyrax/permission_levels_helper.rb', line 26

def configured_permission_options
  Hyrax.config.permission_options.values.index_by do |option|
    I18n.t("hyrax.permission_levels.options.#{option}")
  end
end