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-core-0.7.4 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.7.3 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.7.2 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.7.1 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.7.0 app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.6.8 app/controllers/concerns/decidim/user_profile.rb
decidim-0.6.8 decidim-core/app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.6.7 app/controllers/concerns/decidim/user_profile.rb
decidim-0.6.7 decidim-core/app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.6.6 app/controllers/concerns/decidim/user_profile.rb
decidim-0.6.6 decidim-core/app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.6.5 app/controllers/concerns/decidim/user_profile.rb
decidim-0.6.5 decidim-core/app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.6.4 app/controllers/concerns/decidim/user_profile.rb
decidim-0.6.4 decidim-core/app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.6.3 app/controllers/concerns/decidim/user_profile.rb
decidim-0.6.3 decidim-core/app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.6.2 app/controllers/concerns/decidim/user_profile.rb
decidim-0.6.2 decidim-core/app/controllers/concerns/decidim/user_profile.rb
decidim-core-0.6.1 app/controllers/concerns/decidim/user_profile.rb