devise_masquerade 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of devise_masquerade might be problematic. Click here for more details.
- data/README.md +16 -0
- data/Rakefile +1 -1
- data/features/back.feature +0 -1
- data/lib/devise_masquerade/version.rb +1 -1
- data/spec/dummy/db/seeds.rb +3 -0
- metadata +3 -1
data/README.md
CHANGED
@@ -33,6 +33,13 @@ Add into your application_controller.rb:
|
|
33
33
|
|
34
34
|
Instead of user you can use your resource name admin, student or another names.
|
35
35
|
|
36
|
+
If you want to back to the owner of masquerade action user you could use
|
37
|
+
helpers:
|
38
|
+
|
39
|
+
user_masquerade? # current user was masqueraded by owner?
|
40
|
+
|
41
|
+
= link_to "Reverse masquerade", back_masquerade_path(current_user)
|
42
|
+
|
36
43
|
## Custom controller for adding cancan for authorization
|
37
44
|
|
38
45
|
class Admin::MasqueradesController < Devise::MasqueradesController
|
@@ -65,6 +72,15 @@ Instead of user you can use your resource name admin, student or another names.
|
|
65
72
|
Devise.masquerade_expires_in = 10.seconds
|
66
73
|
Devise.masquerade_key_size = 16 # size of the generate by SecureRandom.base64
|
67
74
|
|
75
|
+
## Demo project
|
76
|
+
|
77
|
+
cd spec/dummy
|
78
|
+
rake db:setup
|
79
|
+
rails server
|
80
|
+
|
81
|
+
And check http://localhost:3000/, use for login user1@example.com and
|
82
|
+
'password'
|
83
|
+
|
68
84
|
## Contributing
|
69
85
|
|
70
86
|
1. Fork it
|
data/Rakefile
CHANGED
data/features/back.feature
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_masquerade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- spec/dummy/config/routes.rb
|
119
119
|
- spec/dummy/db/migrate/20121119085620_devise_create_users.rb
|
120
120
|
- spec/dummy/db/schema.rb
|
121
|
+
- spec/dummy/db/seeds.rb
|
121
122
|
- spec/dummy/public/.empty
|
122
123
|
- spec/dummy/script/rails
|
123
124
|
- spec/models/user_spec.rb
|
@@ -183,6 +184,7 @@ test_files:
|
|
183
184
|
- spec/dummy/config/routes.rb
|
184
185
|
- spec/dummy/db/migrate/20121119085620_devise_create_users.rb
|
185
186
|
- spec/dummy/db/schema.rb
|
187
|
+
- spec/dummy/db/seeds.rb
|
186
188
|
- spec/dummy/public/.empty
|
187
189
|
- spec/dummy/script/rails
|
188
190
|
- spec/models/user_spec.rb
|