From b2d0be014c5bbfe14b892fbc108b6450ffb940eb Mon Sep 17 00:00:00 2001 From: Wawilski Date: Sun, 17 Mar 2024 15:59:12 +0100 Subject: [PATCH] UserList and Student List part1 --- .../Clyde/EndPoints/UserController.java | 6 +- frontend/public/i18n/EN.txt | 10 +-- frontend/public/i18n/FR.txt | 10 +-- frontend/src/Apps/StudentsList.vue | 63 ++----------------- frontend/src/Apps/UsersList.vue | 5 +- frontend/src/rest/Users.js | 4 +- 6 files changed, 22 insertions(+), 76 deletions(-) diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java index 9461ba4..c43b195 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java @@ -48,9 +48,9 @@ public class UserController { } @GetMapping("/users") - public ResponseEntity>> getAllUsers(@RequestHeader("Authorization") String authorization){ - - if (authServ.isNotSecretaryOrAdmin(authorization)) + public ResponseEntity>> getAllUsers(@RequestHeader("authorization") String authorization){ + System.out.println(authorization); + if (authServ.IsNotIn(new Role[]{Role.Admin,Role.Secretary},authorization)) return new UnauthorizedResponse<>(null); Iterable users = userService.getAll(); diff --git a/frontend/public/i18n/EN.txt b/frontend/public/i18n/EN.txt index f3bfa22..283a781 100644 --- a/frontend/public/i18n/EN.txt +++ b/frontend/public/i18n/EN.txt @@ -45,9 +45,9 @@ profile.address=Address profile.picture=Profile picture profile.change.curriculum=Change curriculum name=Name -teacher=Teacher -student=Student -secretary=Secretary -curriculum=curriculum -credits=Credits +Teacher=Teacher +Student=Student +Secretary=Secretary +Curriculum=curriculum +Credits=Credits faculty=Faculty diff --git a/frontend/public/i18n/FR.txt b/frontend/public/i18n/FR.txt index f86b26c..15fa856 100644 --- a/frontend/public/i18n/FR.txt +++ b/frontend/public/i18n/FR.txt @@ -45,9 +45,9 @@ profile.address=Adresse profile.picture=Photo de profil profile.change.curriculum=Changer cursus name=Nom -teacher=Enseignant -student=Etudiant -secretary=Secrétaire -curriculum=Cursus -credits=Credits +Teacher=Enseignant +Student=Etudiant +Secretary=Secrétaire +Curriculum=Cursus +Credits=Credits faculty=Faculté diff --git a/frontend/src/Apps/StudentsList.vue b/frontend/src/Apps/StudentsList.vue index 93fee03..89dae0b 100644 --- a/frontend/src/Apps/StudentsList.vue +++ b/frontend/src/Apps/StudentsList.vue @@ -1,72 +1,17 @@