theforeman/foreman — pull request #1665 by domcleal (2014-08-07 15:59:47+00:00)
Title: fixes #6878 - replace default scope that hides users with explicit scope

My aim is to fix http://projects.theforeman.org/issues/6964, which remained after my attempt to fix a similar issue in 3dd51f407. This latest error in 6964 is again caused by the default scope hiding users, so associations aren't resolving properly in user roles, which causes problems with role caching.

I could have continued to add workarounds to find users that aren't shown by the default scope, but decided instead to implement 6878 and try to hide hidden users at the controller level instead. It was much easier than I expected, but would appreciate any help thinking of remaining issues where hidden users might be visible when they shouldn't be.