 				expect(body.privilegeLevel).to.be.oneOf ["readAndWrite"]
 			, cb)
 	], callback
-
-
-
 
 
 describe 'TokenAccess', ->

					expect(body.privilegeLevel).to.equal false
				, done)


	# describe 'anonymous read-only token', ->
	# 	beforeEach ->

	# 	describe 'made private again', ->
	# 		beforeEach ->

	# describe 'read-and-write token', ->
	# 	beforeEach ->

	# 	describe 'made private again', ->
	# 		beforeEach ->

		test(response, body)
		callback()

try_anon_content_access = (user, project_id, token, test, callback) ->
	# The real-time service calls this end point to determine the user's 
	# permissions.
	if user.id?
		user_id = user.id
	else
		user_id = "anonymous-user"
	request.post {
		url: "/project/#{project_id}/join"
		qs: {user_id}
		auth:
			user: settings.apis.web.user
			pass: settings.apis.web.pass
			sendImmediately: true
		headers:
			'x-sl-anon-token': token
		json: true
		jar: false
	}, (error, response, body) ->
		return callback(error) if error?
		test(response, body)
		callback()

expect_content_write_access = (user, project_id, callback) ->
	try_content_access(user, project_id, (response, body) ->
		expect(body.privilegeLevel).to.be.oneOf ["readAndWrite"]
