Skip to content

Commit 8ee53aa

Browse files
committed
Fixed bug with public read and authorization
1 parent 35883dc commit 8ee53aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/computate/frFR/java/EcrireApiClasse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,7 +2163,7 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
21632163
if(StringUtils.containsAny(classeApiMethode, "POST", "PUT", "PATCH", "DELETE"))
21642164
tl(2, "LOG.debug(String.format(\"", classeApiOperationIdMethode, " ", i18nGlobale.getString(I18n.str_a_démarré), ". \"));");
21652165

2166-
if(classeRessourcesAutorisation.size() > 0 && classeApiMethode.equals(i18nGlobale.getString(I18n.var_PageRecherche))) {
2166+
if(!classePublicLire && classeRessourcesAutorisation.size() > 0 && classeApiMethode.equals(i18nGlobale.getString(I18n.var_PageRecherche))) {
21672167
tl(2, "oauth2AuthenticationProvider.refresh(User.create(", i18nGlobale.getString(I18n.var_requeteService), ".getUser())).onSuccess(user -> {");
21682168
tl(3, "serviceRequest.setUser(user.principal());");
21692169
}
@@ -2562,7 +2562,7 @@ else if(classeApiMethode.equals(i18nGlobale.getString(I18n.var_PUTFusion)) || cl
25622562
tl(3, i18nGlobale.getString(I18n.var_erreur), "(null, ", i18nGlobale.getString(I18n.var_gestionnaireEvenements), ", ex);");
25632563
}
25642564
tl(2, "});");
2565-
if(classeRessourcesAutorisation.size() > 0 && classeApiMethode.equals(i18nGlobale.getString(I18n.var_PageRecherche))) {
2565+
if(!classePublicLire && classeRessourcesAutorisation.size() > 0 && classeApiMethode.equals(i18nGlobale.getString(I18n.var_PageRecherche))) {
25662566
tl(2, "}).onFailure(ex -> {");
25672567
if(activerOpenIdConnect) {
25682568
tl(3, "if(\"Inactive Token\".equals(ex.getMessage()) || StringUtils.startsWith(ex.getMessage(), \"invalid_grant:\")) {");

0 commit comments

Comments
 (0)