src/common-ui/lib/common-ui/user_utils.rb
# assigned by an initializer in lib/common-ui/engine.rb
assigned by an initializer in lib/common-ui/engine.rb
assigned by an initializer in lib / common - ui / engine . rb
def current_user
      return @current_user if @current_user
      user = User.new
      if servlet_request
        user.name = servlet_request.getRemoteUser
        UserUtils.privilege_roles.each do |privilege, roles|
          roles.each do |role|
            if servlet_request.isUserInRole(role)
              user.privileges << privilege.to_sym
            end
          end
        end
      elsif Rails.env.start_with?("devel") || Rails.env.test?
        user.name = "development"
        UserUtils.privilege_roles.each do |privilege, roles|
          user.privileges << privilege.to_sym
        end
      end
      @current_user = user
    end
def current_user return @current_user if @current_user user = User . new if servlet_request user . name = servlet_request . getRemoteUser UserUtils . privilege_roles . each do | privilege , roles | roles . each do | role | if servlet_request . isUserInRole ( role ) user . privileges << privilege . to_sym end end end elsif Rails . env . start_with? ( "devel" ) || Rails . env . test? user . name = "development" UserUtils . privilege_roles . each do | privilege , roles | user . privileges << privilege . to_sym end end @current_user = user end
assigned by an initializer in lib/common-ui/engine.rb
assigned by an initializer in lib / common - ui / engine . rb
# logger.debug("adding #{role} privilege: #{privilege}")