From 778d9cc1c6c49224a04ab110685990b51ae0d32a Mon Sep 17 00:00:00 2001
From: Alberto Defendi <1369-ahl-berto@users.noreply.gitlab.inf.unibz.it>
Date: Wed, 23 Jun 2021 07:43:08 +0200
Subject: [PATCH] Setup roles/routes for driver.

---
 src/api/routes.ts    | 1 +
 src/roles/Driver.tsx | 7 +++++++
 2 files changed, 8 insertions(+)
 create mode 100644 src/roles/Driver.tsx

diff --git a/src/api/routes.ts b/src/api/routes.ts
index 49c0b4b..8e4a8a4 100644
--- a/src/api/routes.ts
+++ b/src/api/routes.ts
@@ -10,6 +10,7 @@ export enum AuthRoutes {
   reservation = '/reservation',
   choseRole = '/choseRole',
   vehicle = '/vehicle',
+  driver = '/driver',
 }
 
 /**
diff --git a/src/roles/Driver.tsx b/src/roles/Driver.tsx
new file mode 100644
index 0000000..1f0c3fb
--- /dev/null
+++ b/src/roles/Driver.tsx
@@ -0,0 +1,7 @@
+import { withAuthorization } from 'components/Authorization/Authorization';
+import { Roles } from 'roles/userRoles';
+
+/**
+ * Wrapper for pages that can be accessed by drivers.
+ */
+export const Driver = withAuthorization([Roles.driver]);
-- 
GitLab