public function add($data = [])
	{
		if (isset($data['email']) && isset($data['username']) && isset($data['password'])) {
			// todo asserts
			$create = array(
				'email' => $data['email'],
				'username' => Strings::webalize($data['username']),
				'password' => Passwords::hash($data['password']),
			);

		} else {
			throw new \InvalidArgumentException('We need username, email and password');
		}

		if (isset($data['role'])) {
			$create['role'] = $data['role'];
		} else {
			$create['role'] = 'user';
		}

		if (isset($data['name'])) {
			$create['name'] = $data['name'];
		}

		/** @var \Nette\Http\FileUpload $data ->avatar */
		if ($this->useFiles && $data['avatar'] && $data['avatar']->isOk()) {
			$create['avatar'] = $this->saveImage($data['avatar']);
		}

		$person = $this->repository->insert($create);

		return $person;
	}