Sha256: 843815b104bceb567eff1bce80c3a059fcdf0f08376c162946a1c1c7e0789f7b

Contents?: true

Size: 1.01 KB

Versions: 58

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

require "active_support/concern"

module Decidim
  # The UserProfile concern must be included in all the controllers
  # that are shown in the user's profile settings. It adds the
  # proper layout, as well as helper methods that help render the
  # side menu, amongst others.
  module UserProfile
    extend ActiveSupport::Concern
    include FormFactory
    include UserGroups

    included do
      helper Decidim::UserProfileHelper
      layout "layouts/decidim/user_profile"

      helper_method :available_verification_workflows

      before_action :current_user
      before_action do
        enforce_permission_to :update_profile, :user, current_user: current_user
      end
    end

    # Public: Available authorization handlers in order to conditionally
    # show the menu element.
    def available_verification_workflows
      Verifications::Adapter.from_collection(
        current_organization.available_authorizations & Decidim.authorization_workflows.map(&:name)
      )
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
decidim-core-0.27.9 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.27.8 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.27.7 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.27.6 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.26.10 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.26.9 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.27.5 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.26.8 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.27.4 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.27.3 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.26.7 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.26.5 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.27.2 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.27.1 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.26.4 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.27.0 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.26.3 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.27.0.rc2 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.27.0.rc1 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.26.2 app/controllers/concerns/decidim/user_profile.rb