         "Attempt to create group '#{group}' which already exists"
     Groups.insert
       name: group
-      members: []
+      members: []  ## will be updated by role change below
       created: new Date
-      creator: Meteor.user().username
+      creator: username
+    ## Give the group creator full access rights to the group,
+    ## so that they don't need global admin permissions to tweak it.
+    Meteor.users.update
+      username: username
+    , $addToSet: "roles.#{escapeGroup group}": $each: allRoles
 
 @groupSortedBy = (group, sort, options, user = Meteor.user()) ->
   query = accessibleMessagesQuery group, user

       $set: weekStart: weekStart

  groupNew: (group) ->
    check group, String
    unless groupRoleCheck wildGroup, 'super'
      throw new Meteor.Error 'groupNew.unauthorized',

@wildGroup = '*'
@anonymousUser = '*'
@readAllUser = '[READ-ALL]'
@allRoles = ['read', 'post', 'edit', 'super', 'admin']

@escapeGroup = escapeKey
@unescapeGroup = unescapeKey
