Commit Graph

2 Commits

Author SHA1 Message Date
Rémy Coutable d95b709a66
Be smarter when finding a sudoed user in API::Helpers
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-13 15:53:00 +01:00
Rémy Coutable 2f45d3bcf0 API: Memoize the current_user so that the sudo can work properly
The issue was arising when `#current_user` was called a second time
after a user was impersonated: the `User#is_admin?` check would be
performed on it and it would fail.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-12 13:50:31 +01:00