Sha256: c47d9b11569c3a6e239316925f9ad0a89085f54f5a80862bb8f485af9cb64da8

Contents?: true

Size: 825 Bytes

Versions: 7

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 permission_resource
          :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

7 entries across 7 versions & 1 rubygems

Version Path
decidim-admin-0.28.4 app/controllers/concerns/decidim/admin/global_moderation_context.rb
decidim-admin-0.28.3 app/controllers/concerns/decidim/admin/global_moderation_context.rb
decidim-admin-0.28.2 app/controllers/concerns/decidim/admin/global_moderation_context.rb
decidim-admin-0.28.1 app/controllers/concerns/decidim/admin/global_moderation_context.rb
decidim-admin-0.28.0 app/controllers/concerns/decidim/admin/global_moderation_context.rb
decidim-admin-0.28.0.rc5 app/controllers/concerns/decidim/admin/global_moderation_context.rb
decidim-admin-0.28.0.rc4 app/controllers/concerns/decidim/admin/global_moderation_context.rb