{"id":2613,"date":"2018-01-07T17:21:26","date_gmt":"2018-01-07T23:21:26","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=2613"},"modified":"2022-08-27T10:10:18","modified_gmt":"2022-08-27T16:10:18","slug":"useful-rails-gems-pretender","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/2613","title":{"rendered":"Useful Rails Gems: Pretender"},"content":{"rendered":"<p>I&#8217;m constantly amazed at how productive you can be with rails. It simply lets you work on typical webapp problems at a much higher level. At 8z, we had a web application and a customer support team. Occasionally the customer support person had to &#8216;impersonate&#8217; a normal user to troubleshoot an issue. We built a piece of software that let them assume that role. (We called it &#8216;<a href=\"https:\/\/www.sudo.ws\/\">sudo<\/a>&#8216;, obviously.) It&#8217;s been a few years, but as I recall it was complicated and error prone, lived on a different domain and wasn&#8217;t fully functional.<\/p>\n<p>I needed to add similar functionality to a rails web app, and was able to find a couple of gems that looked useful. I selected pretender, mostly on the basis of <a href=\"http:\/\/www.mooreds.com\/wordpress\/archives\/188\">documentation<\/a> and google search results placement. I followed the instructions, tweaked a few settings and was off to the races in about an hour.\u00a0 (Note this isn&#8217;t a fair apples to apples comparison of the underlying technologies, due to the differences in available open source libraries between the mid 2000s and the late 2010s.)<\/p>\n<p>Now, all this gem does is what it says it does. It lets a certain user or set of users in your application pretend to be another user. It doesn&#8217;t handle auditing or anything else you might want with an elevated privilege system.<\/p>\n<p>But it does do what it does <strong>well<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m constantly amazed at how productive you can be with rails. It simply lets you work on typical webapp problems at a much higher level. At 8z, we had a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47,35,12,77],"tags":[],"class_list":["post-2613","post","type-post","status-publish","format-standard","hentry","category-8z","category-business","category-consulting","category-rails"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/2613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2613"}],"version-history":[{"count":1,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/2613\/revisions"}],"predecessor-version":[{"id":2614,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/2613\/revisions\/2614"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}