# Class: GMEAuth

## Server:GMEAuth~ GMEAuth

#### new GMEAuth(session, gmeConfig)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `session` |  |
  `gmeConfig` |  |

  ##### Returns:

  Type
    Object

### Methods

#### <inner> addMongoOpsToPromize()

  '_organizations' collection has these fields: _id: username projects: map from project name to object {read:, write:, delete: }

#### <inner> addOrganization(orgId [, callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `orgId` | string |  |
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> addUser(userId, email, password [, canCreate], options [, callback])

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `userId` | string |  |  |
  `email` | string |  |  |
  `password` | string |  |  |
  `canCreate` | boolean | <optional> | false |
  `options` | object |  |  |
  `callback` | function | <optional> |  |

  ##### Returns:

  Type
    *

#### <inner> addUserToOrganization(userId, orgId [, callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `userId` |  |  |
  `orgId` | string |  |
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> connect( [callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> deleteUser(userId, force [, callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `userId` | string |  |
  `force` | boolean |  | removes the user from the db completely
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> getOrganization(orgId, {object [, callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `orgId` | string |  |
  `{object` |  |  | [query]
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> getUser(userId, {object [, callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `userId` | string |  |
  `{object` |  |  | [query]
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> listOrganizations( [query] [, callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `query` | object | <optional> |
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> listUsers( [query] [, projection] [, callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `query` | object | <optional> |
  `projection` | object | <optional> |
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> reEnableUser(userId [, callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `userId` | string |  |
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> removeOrganizationByOrgId(orgId [, force] [, callback])

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `orgId` | string |  |  |
  `force` | boolean | <optional> | false | delete organization from db.
  `callback` | function | <optional> |  |

  ##### Returns:

  Type
    *

#### <inner> removeUserFromOrganization(userId, orgId [, callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `userId` |  |  |
  `orgId` |  |  |
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> setAdminForUserInOrganization(userId, orgId, makeAdmin [, callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `userId` | string |  |
  `orgId` | string |  |
  `makeAdmin` | boolean |  |
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> unload( [callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> updateOrganizationInfo(orgId, {object [, callback])

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `orgId` | string |  |
  `{object` |  |  | info
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> updateUser(userId, userData [, callback])

  Updates/overwrites provided fields for the userData.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `userId` | string |  |
  `userData` | object |  |
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> updateUserComponentSettings(userId, componentId, settings [, overwrite] [, callback])

  Updates the provided fields in the settings stored at given componentId.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `userId` | string |  |
  `componentId` | string |  |
  `settings` | object |  |
  `overwrite` | boolean | <optional> | if true the settings for the key will be overwritten.
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> updateUserDataField(userId, data [, overwrite] [, callback])

  Updates the provided fields in data (recursively) within userData.data.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `userId` | string |  |
  `data` | object |  |
  `overwrite` | boolean | <optional> | if true the settings for the key will be overwritten.
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### <inner> updateUserSettings(userId, settings [, overwrite] [, callback])

  Updates the provided fields in the settings.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `userId` | string |  |
  `settings` | object |  |
  `overwrite` | boolean | <optional> | if true the settings for the key will be overwritten.
  `callback` | function | <optional> |

  ##### Returns:

  Type
    *

#### Search results