code: function(rules) {
        var normalizedRules = {};
        _.each(rules, function(rule) {
          _.each(rule.apiGroups, function(apiGroup) {
            if (!normalizedRules[apiGroup]) {
              normalizedRules[apiGroup] = {};
            }
            _.each(rule.resources, function(resource) {
              normalizedRules[apiGroup][resource] = rule.verbs;
            });
          });
        });
        return normalizedRules;
      }
docs: Transform data from: rules = {resources: ["jobs"], apiGroups: ["extensions"], verbs:["create","delete","get","list","update"]} into: normalizedRules = {"extensions": {"jobs": ["create","delete","get","list","update"]}}