Sha256: b675f05e5a3cee9964b5e1fa8ac2ee28e99de6da3e584229bc2b9bc4476484a7

Contents?: true

Size: 953 Bytes

Versions: 36

Compression:

Stored size: 953 Bytes

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

    delegate :user_groups, to: :current_user, prefix: false

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

      helper_method :available_authorization_handlers,
                    :user_groups

      before_action :current_user
      authorize_resource :current_user
    end

    # Public: Available authorization handlers in order to conditionally
    # show the menu element.
    def available_authorization_handlers
      current_organization.available_authorizations.map(&:constantize)
    end
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
decidim-0.6.1 decidim-core/app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.6.0 app/controllers/concerns/decidim/user_profile.rb
decidim-0.6.0 decidim-core/app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.5.1 app/controllers/concerns/decidim/user_profile.rb
decidim-0.5.1 decidim-core/app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.5.0 app/controllers/concerns/decidim/user_profile.rb
decidim-0.5.0 decidim-core/app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.4.4 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.4.2 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.4.1 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.4.3 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.4.0 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.3.2 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.3.1 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.3.0 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.2.0 app/controllers/concerns/decidim/user_profile.rb