Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add "can_impersonate?" #5

Open
DaveSanders opened this Issue Jun 28, 2013 · 1 comment

Comments

Projects
None yet
1 participant

There needs to be an option that is more granular than just "staff?" for impersonation. I'd like to see a method option where you can specify "can_impersonate?(user_id)" and then let the model make tests against that user.

For example: I might have customer service staff who I need to allow to impersonate customers, but I would never want them to be able to impersonate an administrator. So, my implementation of can_impersonate? would reject it if the impersonated account were an admin.

This is a definite need in our project so I'm going to try to add it in and submit a pull request, but wanted to post this first just in case there was already a way to do this and I was missing it. As far as I can tell staff? doesn't pass anything in.

Put pull request for this in Issue #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment