Defining dynamic keys using smart schema for yogiben:admin and alanning:roles


#1

I’m using alanning:roles and so my roles collection looks something like this:

roles:
{    
    "group_123":["read", "admin"],
    "group_randomtext":["read"]
}
or
roles:["admin", "read"]

Some smart guy over at meteor-admin suggested attaching a schema to it:

var RolesSchema = new SimpleSchema({
  name: {
    type: String,
    label: 'Name'
  }
});

Meteor.roles.attachSchema(RolesSchema);

This works if the roles is a array of strings however, how do you specify in smart schemas that the key is a dynamic string?
I just want to be able to crud groups and roles or at least view them.