Sha256: db1584b5397fdf3f1f19de90d1c500576428f7a0b094c3d616b5bec35c93e251

Contents?: true

Size: 412 Bytes

Versions: 22

Compression:

Stored size: 412 Bytes

Contents

module CanTango
  module Users
    module Masquerade

      attr_reader :masquerading

      def masquerade_as user
        @masquerading = true
        user = user.kind_of?(String) ? ::User.find(user) : user
        @active_user = user
      end

      def stop_masquerade
        @active_user, @masquerading = nil, nil
      end

      def masquerading?
        !@masquerading.nil?
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
cantango-0.9.4.7 lib/cantango/users/masquerade.rb
cantango-0.9.4.6 lib/cantango/users/masquerade.rb
cantango-0.9.4.5 lib/cantango/users/masquerade.rb
cantango-0.9.4.3 lib/cantango/users/masquerade.rb
cantango-0.9.4.2 lib/cantango/users/masquerade.rb
cantango-0.9.4.1 lib/cantango/users/masquerade.rb
cantango-0.9.4 lib/cantango/users/masquerade.rb
cantango-0.9.3.2 lib/cantango/users/masquerade.rb
cantango-0.8.9.5 lib/cantango/users/masquerade.rb
cantango-0.8.9.4 lib/cantango/users/masquerade.rb
cantango-0.8.9.3 lib/cantango/users/masquerade.rb
cantango-0.8.9.2 lib/cantango/users/masquerade.rb
cantango-0.8.9.1 lib/cantango/users/masquerade.rb
cantango-0.8.9 lib/cantango/users/masquerade.rb
cantango-0.8.8.1 lib/cantango/users/masquerade.rb
cantango-0.8.8 lib/cantango/users/masquerade.rb
cantango-0.8.7 lib/cantango/users/masquerade.rb
cantango-0.8.6.2 lib/cantango/users/masquerade.rb
cantango-0.8.6.1 lib/cantango/users/masquerade.rb
cantango-0.8.6 lib/cantango/users/masquerade.rb