Sha256: 1809d1b3dacfdcee5021b47c8b574d411bf90b1fd9c6a2d6abfc7b2dda63703f

Contents?: true

Size: 613 Bytes

Versions: 71

Compression:

Stored size: 613 Bytes

Contents

# frozen_string_literal: true

require "active_support/concern"

module Decidim
  module Admin
    # The UserGroups concern must be included in all controllers related
    # to UserGroups feature. It adds a method to enforce that the feature
    # is enabled.
    module UserGroups
      extend ActiveSupport::Concern

      included do
        delegate :user_groups_enabled?, to: :current_organization

        helper_method :user_groups_enabled?
      end

      def enforce_user_groups_enabled
        raise Decidim::ActionForbidden unless current_organization.user_groups_enabled?
      end
    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
decidim-admin-0.29.1 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.28.4 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.27.9 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.29.0 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.28.3 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.27.8 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.29.0.rc4 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.29.0.rc3 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.29.0.rc2 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.29.0.rc1 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.28.2 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.27.7 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.28.1 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.27.6 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.26.10 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.26.9 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.28.0 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.27.5 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.28.0.rc5 app/controllers/concerns/decidim/admin/user_groups.rb
decidim-admin-0.28.0.rc4 app/controllers/concerns/decidim/admin/user_groups.rb