           name: group
         , $pull: anonymous: role
     else
-      key = 'roles.' + escapeGroup group
-      op = {}
-      op[key] = role
+      op =
+        "roles.#{escapeGroup group}": role
       if yesno
         Meteor.users.update
           username: user

@wildGroup = '*'
@anonymousUser = '*'
@readAllUser = '[READ-ALL]'

@escapeGroup = escapeKey
@unescapeGroup = unescapeKey

        "Attempt to create group '#{group}' which already exists"
    Groups.insert
      name: group
      members: []  ## will be updated by role change below
      created: new Date
      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
