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.2.0.0.0 lib/fiona7/current_user_map.rb
infopark_fiona7-1.1.0.0.9 lib/fiona7/current_user_map.rb
infopark_fiona7-1.1.0.0.8 lib/fiona7/current_user_map.rb
infopark_fiona7-1.1.0.0.7 lib/fiona7/current_user_map.rb
infopark_fiona7-1.1.0.0.6 lib/fiona7/current_user_map.rb
infopark_fiona7-1.1.0.0.5 lib/fiona7/current_user_map.rb
infopark_fiona7-1.1.0.0.4 lib/fiona7/current_user_map.rb
infopark_fiona7-1.1.0.0.3 lib/fiona7/current_user_map.rb
infopark_fiona7-1.1.0.0.2 lib/fiona7/current_user_map.rb
infopark_fiona7-1.1.0.0.10 lib/fiona7/current_user_map.rb
infopark_fiona7-1.1.0.0.1 lib/fiona7/current_user_map.rb
infopark_fiona7-1.1.0.0.0 lib/fiona7/current_user_map.rb
infopark_fiona7-0.71.1.9 lib/fiona7/current_user_map.rb
infopark_fiona7-0.71.1.8 lib/fiona7/current_user_map.rb
infopark_fiona7-0.71.1.7 lib/fiona7/current_user_map.rb
infopark_fiona7-0.71.1.6 lib/fiona7/current_user_map.rb
infopark_fiona7-0.71.1.5 lib/fiona7/current_user_map.rb
infopark_fiona7-0.71.1.4 lib/fiona7/current_user_map.rb
infopark_fiona7-0.71.1.3 lib/fiona7/current_user_map.rb
infopark_fiona7-0.71.1.2 lib/fiona7/current_user_map.rb