README.md in devise_masquerade-0.6.2 vs README.md in devise_masquerade-0.6.3
- old
+ new
@@ -1,7 +1,8 @@
# Devise Masquerade
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/oivoodoo/devise_masquerade?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Foivoodoo%2Fdevise_masquerade.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Foivoodoo%2Fdevise_masquerade?ref=badge_shield)
[![Build Status](https://secure.travis-ci.org/oivoodoo/devise_masquerade.png?branch=master)](https://travis-ci.org/oivoodoo/devise_masquerade)
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/oivoodoo/devise_masquerade)
@@ -79,11 +80,11 @@
Controller:
```ruby
class Admin::MasqueradesController < Devise::MasqueradesController
protected
-
+
def masquerade_authorize!
authorize(User, :masquerade?) unless params[:action] == 'back'
end
end
```
@@ -113,11 +114,11 @@
For example, if you use FriendlyId:
```ruby
class Admin::MasqueradesController < Devise::MasqueradesController
protected
-
+
def find_resource
masqueraded_resource_class.friendly.find(params[:id])
end
end
```
@@ -135,10 +136,12 @@
Devise.masquerade_param = 'masquerade'
Devise.masquerade_expires_in = 10.seconds
Devise.masquerade_key_size = 16 # size of the generate by SecureRandom.urlsafe_base64
Devise.masquerade_bypass_warden_callback = false
Devise.masquerade_routes_back = false # if true, route back to the page the user was on via redirect_back
+ Devise.masquerading_resource_class = User
+ Devise.masqueraded_resource_class = AdminUser
```
## Demo project
cd spec/dummy
@@ -157,5 +160,9 @@
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
+
+
+## License
+[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Foivoodoo%2Fdevise_masquerade.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Foivoodoo%2Fdevise_masquerade?ref=badge_large)