homeserve-alliance/comfortable-mexican-sofa — pull request #1 by jalada (2014-04-11 17:58:42+00:00)
Title: Dynamically redirecting users on initial login, and User controller fixes

Hi guys!

There are a few changes here. And I think you're going to pick some holes (good!) in what I've done.

1. Comfy already had the facility to choose where to redirect a user on first sign in, but it was just a hard-coded string. In this branch, it is possible to pass a block to the configuration option instead of a string, and that block is evaluated within the scope of the controller using it.
2. The User controller was in dire need of some love. It was made in a hurry when we made Comfy multi-tenant, and it showed. In particular it was completely lacking in tests.
3. CanCan support has been fleshed out. I'm using the community-maintained CanCanCan, and the `Cms::Ability` has a lot more defined in it.

There are a couple of things that still need doing, and I put it to you guys to say whether you think it's needed before this gets merged in.

1. The functionality to pass a block to the redirect config option isn't well documented.
2. Not all the CMS controllers use CanCan, which is a security risk and nasty.

Please browse the code, and let me know what you think.