From 7aeb473d02f85312c4f1623304498d6660e58d97 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sun, 15 May 2022 17:08:00 +0200 Subject: [PATCH] Organisation code avec commentaire --- .../com/covas/Resources/UsersRessources.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/covas/Resources/UsersRessources.java b/src/main/java/com/covas/Resources/UsersRessources.java index fa122dd..86cac89 100644 --- a/src/main/java/com/covas/Resources/UsersRessources.java +++ b/src/main/java/com/covas/Resources/UsersRessources.java @@ -29,7 +29,19 @@ public class UsersRessources { private static final Logger LOGGER = Logger.getLogger(UsersRessources.class); @Inject JsonWebToken jwt; - + + ///Function + private Boolean checkUserCookie(String userCookie, UsersEntity users){ + String name = new String(Base64.decode(userCookie), StandardCharsets.UTF_8); + if(!name.equals(users.pseudo) && (!users.status)){ + return false; + } + return true; + } + + /// Appel HTTP + + ///GET @GET @RolesAllowed("Admin") public Response getUsers(){ @@ -73,11 +85,6 @@ public class UsersRessources { } return Response.ok(new UserSingle(user.name, user.pseudo, user.firstName)).build(); } - private Boolean checkUserCookie(String userCookie, UsersEntity users){ - String name = new String(Base64.decode(userCookie), StandardCharsets.UTF_8); - if(!name.equals(users.pseudo) && (!users.status)){ - return false; - } - return true; - } + + }