Sha256: 03b34e879aa500d52fc50a665ccebe2f7700d459d5c26c2f21ab93b2a2f29257

Contents?: true

Size: 608 Bytes

Versions: 43

Compression:

Stored size: 608 Bytes

Contents

module Fiona7
  module CurrentUserMapHelper
    def self.groups_for_user(user)
      user_name = user.id rescue ""
      return [] if user_name.blank?
      Reactor::Sudo.su(Fiona7.root) do
        Reactor::Cache::User.instance.get(user_name).groups
      end
    rescue => e
      Rails.logger.error "Error occured while reading user groups of #{user_name} (#{e.message})"
      []
    end
  end

  module CurrentUserMap
    protected
    def current_user
      @current_user ||= OpenStruct.new({
        :live_server_groups => CurrentUserMapHelper.groups_for_user(scrivito_user)
      })
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
infopark_fiona7-1.6.1.1.5 lib/fiona7/current_user_map.rb
infopark_fiona7-1.6.1.1.1 lib/fiona7/current_user_map.rb
infopark_fiona7-1.6.1.1.0 lib/fiona7/current_user_map.rb
infopark_fiona7-1.2.0.2.3 lib/fiona7/current_user_map.rb
infopark_fiona7-1.2.0.2.1 lib/fiona7/current_user_map.rb
infopark_fiona7-1.2.0.2.2 lib/fiona7/current_user_map.rb
infopark_fiona7-1.5.5.5.1 lib/fiona7/current_user_map.rb
infopark_fiona7-1.5.5.5.0 lib/fiona7/current_user_map.rb
infopark_fiona7-1.2.0.1.4 lib/fiona7/current_user_map.rb
infopark_fiona7-1.5.5.4.1 lib/fiona7/current_user_map.rb
infopark_fiona7-1.5.5.4.0 lib/fiona7/current_user_map.rb
infopark_fiona7-1.2.0.1.3 lib/fiona7/current_user_map.rb
infopark_fiona7-1.5.5.3.1 lib/fiona7/current_user_map.rb
infopark_fiona7-1.5.4.3.0 lib/fiona7/current_user_map.rb
infopark_fiona7-1.5.3.2.0 lib/fiona7/current_user_map.rb
infopark_fiona7-1.5.3.2.0.pre.beta1 lib/fiona7/current_user_map.rb
infopark_fiona7-1.5.2.1.0.pre.beta1 lib/fiona7/current_user_map.rb
infopark_fiona7-1.5.2.0.0 lib/fiona7/current_user_map.rb
infopark_fiona7-1.2.0.1.1 lib/fiona7/current_user_map.rb
infopark_fiona7-1.2.0.0.1 lib/fiona7/current_user_map.rb