Ruby on Rails
Wednesday, September 26, 2012
Currently I am using CanCan.
Can you please explain a bit more on your solution?
On Wednesday, September 26, 2012 6:51:43 PM UTC+5:30, Walter Lee Davis wrote:
--
On Sep 26, 2012, at 4:58 AM, Avi wrote:
> Hello,
>
> I have an interesting requirement. Don't know how to do it.
> I have an Admin, which can see a list of users.
> All the users will have a button (Login).
> The Admin can click on the Login button to to access the user's account.
> If Admin does this he will be logged out of his account. But how to access back his own account if he tries to come out of that user's account?
>
What method are you using for authentication? I did something similar in Devise, where I allowed the admin to impersonate another user. I hooked into the current_user method and allowed an admin user to assume the identity of another user without logging out. Since admins were allowed to see everything anyway (in CanCan) I didn't need to do anything special besides store the ID of the account I was impersonating in the session.
Walter
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/udMtXUaASAoJ.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment