Skip to content

Commit

Permalink
Adding support for auth group resource scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
computate committed Oct 17, 2024
1 parent f689d91 commit a492d71
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/org/computate/frFR/java/I18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/org/computate/frFR/java/IndexerClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/org/computate/i18n/i18n_enUS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
</p>
<p><a href="%s/select?q=*:*&fq=partEstClasse_indexed_boolean:true&fq=classeNomCanonique_%s_indexed_string:%s">Find the class %s in Solr. </a></p>
<p><a href="%s/solr/computate/select?q=*:*&fq=partEstClasse_indexed_boolean:true&fq=classeNomCanonique_%s_indexed_string:%s">Find the class %s in Solr. </a></p>
<p>
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.
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/org/computate/i18n/i18n_frFR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a492d71

Please sign in to comment.