engineyard / engineyard/user_impersonate

Add "can_impersonate?"

Open
#5 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
28
Forks
50
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.