Sha256: 5dcd76f6d1daa7f0d5785ace9f0909aad7871e1118f7bf4b27c837256c881ab2

Contents?: true

Size: 825 Bytes

Versions: 6

Compression:

Stored size: 825 Bytes

Contents

# frozen_string_literal: true

require "active_support/concern"

module Decidim
  module Admin
    module GlobalModerationContext
      extend ActiveSupport::Concern

      included do
        # Private: Overwrites the method from the parent controller so that the
        # permission system does not overwrite permissions.
        def authorization_scope
          :global_moderation
        end

        # Private: finds the moderations the current user can manage, taking into
        # account whether the user is an organization-wide admin or a
        # "participatory space admin".
        #
        # Returns an `ActiveRecord::Relation`
        def moderations_for_user
          @moderations_for_user ||= Decidim::Admin::ModerationStats.new(current_user).content_moderations
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-admin-0.29.1 app/controllers/concerns/decidim/admin/global_moderation_context.rb
decidim-admin-0.29.0 app/controllers/concerns/decidim/admin/global_moderation_context.rb
decidim-admin-0.29.0.rc4 app/controllers/concerns/decidim/admin/global_moderation_context.rb
decidim-admin-0.29.0.rc3 app/controllers/concerns/decidim/admin/global_moderation_context.rb
decidim-admin-0.29.0.rc2 app/controllers/concerns/decidim/admin/global_moderation_context.rb
decidim-admin-0.29.0.rc1 app/controllers/concerns/decidim/admin/global_moderation_context.rb