Sha256: 518153ff8b782a3fa6291c280857e8951b81c4f066ec79ef8b4f849558fa2237

Contents?: true

Size: 955 Bytes

Versions: 25

Compression:

Stored size: 955 Bytes

Contents

# frozen_string_literal: true

module Hyrax
  module PermissionLevelsHelper
    ##
    # @return [Hash<String, String>] a map from i18nized strings to permission
    #   level keywords
    def configured_permission_levels
      Hyrax.config.permission_levels.values.index_by do |level|
        I18n.t("hyrax.permission_levels.#{level}")
      end
    end

    ##
    # @return [Hash<String, String>] a map from i18nized strings to permission
    #   level keywords
    def configured_owner_permission_levels
      Hyrax.config.owner_permission_levels.values.index_by do |level|
        I18n.t("hyrax.permission_levels.owner.#{level}")
      end
    end

    ##
    # @return [Hash<String, String>] a map from i18nized strings to permission
    #   level keywords
    def configured_permission_options
      Hyrax.config.permission_options.values.index_by do |option|
        I18n.t("hyrax.permission_levels.options.#{option}")
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/helpers/hyrax/permission_levels_helper.rb
hyrax-5.0.0 app/helpers/hyrax/permission_levels_helper.rb
hyrax-5.0.0.rc3 app/helpers/hyrax/permission_levels_helper.rb
hyrax-5.0.0.rc2 app/helpers/hyrax/permission_levels_helper.rb
hyrax-5.0.0.rc1 app/helpers/hyrax/permission_levels_helper.rb
hyrax-3.6.0 app/helpers/hyrax/permission_levels_helper.rb
hyrax-4.0.0 app/helpers/hyrax/permission_levels_helper.rb
hyrax-4.0.0.rc3 app/helpers/hyrax/permission_levels_helper.rb
hyrax-4.0.0.rc2 app/helpers/hyrax/permission_levels_helper.rb
hyrax-4.0.0.rc1 app/helpers/hyrax/permission_levels_helper.rb
hyrax-3.5.0 app/helpers/hyrax/permission_levels_helper.rb
hyrax-4.0.0.beta2 app/helpers/hyrax/permission_levels_helper.rb
hyrax-3.4.2 app/helpers/hyrax/permission_levels_helper.rb
hyrax-4.0.0.beta1 app/helpers/hyrax/permission_levels_helper.rb
hyrax-3.4.1 app/helpers/hyrax/permission_levels_helper.rb
hyrax-3.4.0 app/helpers/hyrax/permission_levels_helper.rb
hyrax-3.3.0 app/helpers/hyrax/permission_levels_helper.rb
hyrax-3.2.0 app/helpers/hyrax/permission_levels_helper.rb
hyrax-3.1.0 app/helpers/hyrax/permission_levels_helper.rb
hyrax-3.0.2 app/helpers/hyrax/permission_levels_helper.rb