Enum in CamelCase
This commit is contained in:
parent
208c6c63e8
commit
25009ba149
@ -44,17 +44,17 @@ public class ApplicationsController {
|
|||||||
Role posterRole = authServ.getUserFromToken(token).getRole();
|
Role posterRole = authServ.getUserFromToken(token).getRole();
|
||||||
ArrayList<Applications> authorizedApps = new ArrayList<>();
|
ArrayList<Applications> authorizedApps = new ArrayList<>();
|
||||||
|
|
||||||
authorizedApps.add(Applications.LOGIN);
|
authorizedApps.add(Applications.Login);
|
||||||
authorizedApps.add(Applications.PROFILE);
|
authorizedApps.add(Applications.Profile);
|
||||||
authorizedApps.add(Applications.MSG);
|
authorizedApps.add(Applications.Msg);
|
||||||
authorizedApps.add(Applications.FORUM);
|
authorizedApps.add(Applications.Forum);
|
||||||
authorizedApps.add(Applications.RDV);
|
authorizedApps.add(Applications.Rdv);
|
||||||
|
|
||||||
if (posterRole == Role.Student || posterRole == Role.Admin) return authorizedApps;
|
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;
|
return authorizedApps;
|
||||||
}
|
}
|
||||||
|
@ -2,23 +2,20 @@ package ovh.herisson.Clyde.Tables;
|
|||||||
|
|
||||||
public enum Applications {
|
public enum Applications {
|
||||||
// without any token
|
// without any token
|
||||||
LOGIN,
|
Login,
|
||||||
|
|
||||||
// with any token
|
// with any token
|
||||||
PROFILE,
|
Profile,
|
||||||
|
|
||||||
|
|
||||||
// Students and higher authorization
|
// Students and higher authorization
|
||||||
MSG,
|
Msg,
|
||||||
FORUM,
|
Forum,
|
||||||
RDV,
|
Rdv,
|
||||||
|
|
||||||
// teachers and Secretary authorization
|
// teachers and Secretary authorization
|
||||||
MANAGECOURSES,
|
ManageCourses,
|
||||||
|
|
||||||
// InscriptionService authorization
|
// InscriptionService authorization
|
||||||
INSCRIPTION;
|
Inscription
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package ovh.herisson.Clyde.Tables;
|
|||||||
|
|
||||||
public enum CursusType {
|
public enum CursusType {
|
||||||
|
|
||||||
infoBab1,
|
InfoBab1,
|
||||||
chemistryBab1,
|
ChemistryBab1,
|
||||||
psychologyBab1;
|
PsychologyBab1
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,5 @@ package ovh.herisson.Clyde.Tables;
|
|||||||
public enum RequestState {
|
public enum RequestState {
|
||||||
Accepted,
|
Accepted,
|
||||||
Refused,
|
Refused,
|
||||||
Pending;
|
Pending
|
||||||
}
|
}
|
||||||
|
@ -5,5 +5,5 @@ public enum Role {
|
|||||||
Student,
|
Student,
|
||||||
Admin,
|
Admin,
|
||||||
InscriptionService,
|
InscriptionService,
|
||||||
Secretary;
|
Secretary
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user