From a492d716a35a2ae6dccdbb45f7c33054e1021c2a Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Wed, 16 Oct 2024 22:39:39 -0600 Subject: [PATCH] Adding support for auth group resource scopes --- src/main/java/org/computate/frFR/java/I18n.java | 2 ++ .../org/computate/frFR/java/IndexerClasse.java | 15 +++++++++++++++ .../resources/org/computate/i18n/i18n_enUS.yaml | 4 +++- .../resources/org/computate/i18n/i18n_frFR.yaml | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/computate/frFR/java/I18n.java b/src/main/java/org/computate/frFR/java/I18n.java index ac25462..2bee427 100644 --- a/src/main/java/org/computate/frFR/java/I18n.java +++ b/src/main/java/org/computate/frFR/java/I18n.java @@ -126,8 +126,10 @@ public class I18n { public static final String var_attribuer = "var_attribuer"; public static final String var_Attribuer = "var_Attribuer"; public static final String var_AucunNomTrouve = "var_AucunNomTrouve"; + public static final String var_AuthGroupe = "var_AuthGroupe"; public static final String var_authPorteeAdmin = "var_authPorteeAdmin"; public static final String var_authPorteeSuperAdmin = "var_authPorteeSuperAdmin"; + public static final String var_AuthPortees = "var_AuthPortees"; public static final String var_authRoleAdmin = "var_authRoleAdmin"; public static final String var_authRoleSuperAdmin = "var_authRoleSuperAdmin"; public static final String var_AUTH_PORTEE_ADMIN = "var_AUTH_PORTEE_ADMIN"; diff --git a/src/main/java/org/computate/frFR/java/IndexerClasse.java b/src/main/java/org/computate/frFR/java/IndexerClasse.java index c45f75a..9791de4 100644 --- a/src/main/java/org/computate/frFR/java/IndexerClasse.java +++ b/src/main/java/org/computate/frFR/java/IndexerClasse.java @@ -4948,6 +4948,7 @@ else if(StringUtils.equalsAny(entiteNomCanonique, VAL_nomCanoniqueString)) { classePartsGenAjouter(classePartsCouverture, classeLangueNom); String classeNomSimpleLangue = (String)classeDoc.get("classeNomSimple_" + langueNomGlobale + "_stored_string").getValue(); + Boolean classeAuth = false; if(classeApi) { @@ -5073,6 +5074,18 @@ else if(StringUtils.equalsAny(entiteNomCanonique, VAL_nomCanoniqueString)) { classePartsGenApiAjouter(classePartsListeRecherche, classeLangueNom); + JsonObject classeAuthGroupeObjet = regexYamlObject(i18nGlobale.getString(I18n.var_AuthGroupe), classeCommentaire); + if(classeAuthGroupeObjet != null) { + classeAuth = true; + for(String classeAuthGroupe : classeAuthGroupeObjet.fieldNames()) { + JsonObject groupePortees = Optional.ofNullable(classeAuthGroupeObjet.getJsonObject(classeAuthGroupe)).orElse(new JsonObject()); + indexerStockerListeSolr(langueNom, classeDoc, "classeAuthGroupes", classeAuthGroupe); + for(String portee : groupePortees.fieldNames()) { + indexerStockerListeSolr(langueNom, classeDoc, String.format("classeAuthPortees_%s", classeAuthGroupe), portee); + } + } + } + JsonObject apiMethodeObjet = regexYamlObject(i18nGlobale.getString(I18n.var_ApiMethode), classeCommentaire); for(String classeApiMethode : apiMethodeObjet.fieldNames()) { JsonObject apiMethode = Optional.ofNullable(apiMethodeObjet.getJsonObject(classeApiMethode)).orElse(new JsonObject()); @@ -5284,6 +5297,8 @@ else if(i18nGlobale.getString(I18n.var_PUTFusion).equals(classeApiMethode)) } } } + indexerStockerSolr(classeDoc, "classeAuth", classeAuth); + if(classePage) { String classePageNomSimple = classeNomSimpleLangue + i18nGlobale.getString(I18n.var_Page); diff --git a/src/main/resources/org/computate/i18n/i18n_enUS.yaml b/src/main/resources/org/computate/i18n/i18n_enUS.yaml index 82a1f37..6ca604c 100644 --- a/src/main/resources/org/computate/i18n/i18n_enUS.yaml +++ b/src/main/resources/org/computate/i18n/i18n_enUS.yaml @@ -56,7 +56,7 @@ classe: Whenever this Java class is modified or touched, the watch service installed as described in the README, indexes all the information about this Java class in a local Apache Solr Search Engine. If you are running the service, you can see the indexed data about this Java Class here:

-

Find the class %s in Solr.

+

Find the class %s in Solr.

The extended class ending with "Gen" did not exist at first, but was automatically created by the same watch service based on the data retrieved from the local Apache Server search engine. The extended class contains many generated fields, getters, setters, initialization code, and helper methods to help build a website and API fast, reactive, and scalable. @@ -343,8 +343,10 @@ var_a: "to" var_attribuer: "relate" var_Attribuer: "Relate" var_AucunNomTrouve: "NoNameFound" +var_AuthGroupe: "AuthGroup" var_authPorteeAdmin: "authScopeAdmin" var_authPorteeSuperAdmin: "authScopeSuperAdmin" +var_AuthPortees: "AuthScopes" var_authRoleAdmin: "authRoleAdmin" var_authRoleSuperAdmin: "authRoleSuperAdmin" var_AUTH_PORTEE_ADMIN: "AUTH_SCOPE_ADMIN" diff --git a/src/main/resources/org/computate/i18n/i18n_frFR.yaml b/src/main/resources/org/computate/i18n/i18n_frFR.yaml index cb06a5a..eed1aa8 100644 --- a/src/main/resources/org/computate/i18n/i18n_frFR.yaml +++ b/src/main/resources/org/computate/i18n/i18n_frFR.yaml @@ -108,8 +108,10 @@ var_Archive: "Archive" var_attribuer: "attribuer" var_Attribuer: "Attribuer" var_AucunNomTrouve: "AucunNomTrouve" +var_AuthGroupe: "AuthGroupe" var_authPorteeAdmin: "authPorteeAdmin" var_authPorteeSuperAdmin: "authPorteeSuperAdmin" +var_AuthPortees: "AuthPortees" var_authRoleAdmin: "authRoleAdmin" var_authRoleSuperAdmin: "authRoleSuperAdmin" var_AUTH_PORTEE_ADMIN: "AUTH_PORTEE_ADMIN"