rails_admin_impersonate 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,17 @@
1
+ ## RailsAdminImpersonate
2
+
3
+ Add an ability to [rails_admin](https://github.com/sferik/rails_admin) to impersonate as any user or actually any member
4
+ that is devise authenticatable.
5
+
6
+ Installation: just add to your Gemfile.
7
+
8
+ gem 'rails_admin'
9
+ gem 'rails_admin_impersonate'
10
+
11
+ You should see home icon and Impersonate link for every user action.
12
+
13
+ This project rocks and uses MIT-LICENSE.
14
+
15
+ #### Copyright
16
+
17
+ © 2013 [Boris Nadion](mailto:boris@astrails.com)
data/Rakefile ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'RailsAdminImpersonate'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.markdown')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+
24
+
25
+
26
+ Bundler::GemHelper.install_tasks
27
+
@@ -0,0 +1,6 @@
1
+ en:
2
+ admin:
3
+ actions:
4
+ impersonate:
5
+ menu: "Impersonate"
6
+
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
@@ -0,0 +1,4 @@
1
+ module RailsAdminImpersonate
2
+ class Engine < ::Rails::Engine
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ module RailsAdminImpersonate
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,41 @@
1
+ require "rails_admin_impersonate/engine"
2
+
3
+ module RailsAdminImpersonate
4
+ end
5
+
6
+ module RailsAdmin
7
+ module Config
8
+ module Actions
9
+ class Impersonate < RailsAdmin::Config::Actions::Base
10
+ register_instance_option :visible? do
11
+ authorized? && bindings[:object].respond_to?(:devise_modules)
12
+ end
13
+
14
+ register_instance_option :member? do
15
+ true
16
+ end
17
+
18
+ register_instance_option :pjax? do
19
+ false
20
+ end
21
+
22
+ register_instance_option :http_methods do
23
+ [:get]
24
+ end
25
+
26
+ register_instance_option :link_icon do
27
+ 'icon-home'
28
+ end
29
+
30
+ register_instance_option :controller do
31
+ Proc.new do
32
+ sign_in @object
33
+ redirect_to "/"
34
+ end
35
+ end
36
+
37
+ RailsAdmin::Config::Actions.register(self)
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :rails_admin_impersonate do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_admin_impersonate
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Boris Nadion
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-07-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.13
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.13
30
+ - !ruby/object:Gem::Dependency
31
+ name: rails_admin
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 0.4.9
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.4.9
46
+ description:
47
+ email:
48
+ - boris@astrails.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - config/locales/rails_admin_impersonate.yml
54
+ - config/routes.rb
55
+ - lib/rails_admin_impersonate/engine.rb
56
+ - lib/rails_admin_impersonate/version.rb
57
+ - lib/rails_admin_impersonate.rb
58
+ - lib/tasks/rails_admin_impersonate_tasks.rake
59
+ - MIT-LICENSE
60
+ - Rakefile
61
+ - README.markdown
62
+ homepage: https://github.com/astrails/rails_admin_impersonate
63
+ licenses: []
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 1.8.25
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: Impersonate as a Devise user for rails_admin
86
+ test_files: []