1
0
forked from PGL/Clyde

Enum in CamelCase

This commit is contained in:
Bartha Maxime 2024-03-16 00:34:20 +01:00
parent 208c6c63e8
commit 25009ba149
5 changed files with 20 additions and 23 deletions

View File

@ -44,17 +44,17 @@ public class ApplicationsController {
Role posterRole = authServ.getUserFromToken(token).getRole();
ArrayList<Applications> authorizedApps = new ArrayList<>();
authorizedApps.add(Applications.LOGIN);
authorizedApps.add(Applications.PROFILE);
authorizedApps.add(Applications.MSG);
authorizedApps.add(Applications.FORUM);
authorizedApps.add(Applications.RDV);
authorizedApps.add(Applications.Login);
authorizedApps.add(Applications.Profile);
authorizedApps.add(Applications.Msg);
authorizedApps.add(Applications.Forum);
authorizedApps.add(Applications.Rdv);
if (posterRole == Role.Student || posterRole == Role.Admin) return authorizedApps;
if (posterRole == Role.Teacher || posterRole == Role.Secretary || posterRole == Role.Admin) authorizedApps.add(Applications.MANAGECOURSES);
if (posterRole == Role.Teacher || posterRole == Role.Secretary || posterRole == Role.Admin) authorizedApps.add(Applications.ManageCourses);
if (posterRole == Role.InscriptionService || posterRole == Role.Admin) authorizedApps.add(Applications.INSCRIPTION);
if (posterRole == Role.InscriptionService || posterRole == Role.Admin) authorizedApps.add(Applications.Inscription);
return authorizedApps;
}

View File

@ -2,23 +2,20 @@ package ovh.herisson.Clyde.Tables;
public enum Applications {
// without any token
LOGIN,
Login,
// with any token
PROFILE,
Profile,
// Students and higher authorization
MSG,
FORUM,
RDV,
Msg,
Forum,
Rdv,
// teachers and Secretary authorization
MANAGECOURSES,
ManageCourses,
// InscriptionService authorization
INSCRIPTION;
Inscription
}

View File

@ -2,7 +2,7 @@ package ovh.herisson.Clyde.Tables;
public enum CursusType {
infoBab1,
chemistryBab1,
psychologyBab1;
InfoBab1,
ChemistryBab1,
PsychologyBab1
}

View File

@ -3,5 +3,5 @@ package ovh.herisson.Clyde.Tables;
public enum RequestState {
Accepted,
Refused,
Pending;
Pending
}

View File

@ -5,5 +5,5 @@ public enum Role {
Student,
Admin,
InscriptionService,
Secretary;
Secretary
}