 			_id: projectId
 		}, {
 			$addToSet: {tokenAccessReadOnly_refs: userId}
-		}, (err) ->
-			callback(err)
+		}, callback
 
 	addReadAndWriteUserToProject: (userId, projectId, callback=(err)->) ->
 		userId = ObjectId(userId.toString())

		Project.findOne {
			'tokens.readOnly': token,
			'publicAccesLevel': PublicAccessLevels.TOKEN_BASED
		}, {_id: 1, publicAccesLevel: 1}, (err, project) ->
			return callback(err) if err?
			callback(null, project)

	findProjectWithReadAndWriteToken: (token, callback=(err, project)->) ->
		Project.findOne {
			'tokens.readAndWrite': token,
			'publicAccesLevel': PublicAccessLevels.TOKEN_BASED
		}, {_id: 1, publicAccesLevel: 1}, (err, project) ->
			return callback(err) if err?
			callback(null, project)

	addReadOnlyUserToProject: (userId, projectId, callback=(err)->) ->
		userId = ObjectId(userId.toString())

			_id: projectId
		}, {
			$addToSet: {tokenAccessReadAndWrite_refs: userId}
		}, callback

	grantSessionReadOnlyTokenAccess: (req, projectId, token) ->
		if req.session?
