alphagov/gds-sso — pull request #11 by jamiecobbett (2013-01-07 13:42:40+00:00)
Title: Migrate from app name being present in permissions

Signon gives apps a Hash of user permissions, with application names as keys, and an array of permissions as values. Once upon a time, this included every app. This was bad because it widely and unnecessarily shared which user accounts are valuable, so we restricted it to just the app asking for the user data.

GDS::SSO currently picks the permissions out based on the application name (which is configured eg here: https://github.com/alphagov/panopticon/blob/master/config/initializers/gds-sso.rb#L5 ). This is an artefact of the original design and the data format.

These changes remove the weirdness from hanging around, whilst supporting Signon emitting permissions in either Hash or Array format. When we've upgraded every app, we can change Signon. Then we can remove the legacy support.

Upgrading apps (which I intend to do) will mean:
* changing the User model - permissions should be an Array not a Hash
* migrating the User data - from the Hash to the Array

These changes should probably be released as a major version change.