Sha256: 1bac7944a52009790f144ba662b29a987c4a494676c1d3a85b644ea5cdd51212

Contents?: true

Size: 504 Bytes

Versions: 13

Compression:

Stored size: 504 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module DecidimAwesome
    module UserOverride
      extend ActiveSupport::Concern

      included do
        class << self
          attr_accessor :awesome_admins_for_current_scope, :awesome_potential_admins
        end

        def admin
          return self["admin"] if self["admin"]

          Decidim::User.awesome_admins_for_current_scope&.include?(id)
        end

        def admin?
          admin.present?
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-decidim_awesome-0.10.3 app/models/concerns/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.11.2 app/models/concerns/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.11.1 app/models/concerns/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.10.2 app/models/concerns/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.10.1 app/models/concerns/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.10.0 app/models/concerns/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.9.3 app/models/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.9.1 app/models/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.8.3 app/models/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.8.2 app/models/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.8.1 app/models/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.8.0 app/models/decidim/decidim_awesome/user_override.rb
decidim-decidim_awesome-0.7.2 app/models/decidim/decidim_awesome/user_override.rb