fix(frontend): corrections workflow v3.0 — inscription événements, CreateMembreRequest, AJAX session expiry
Services:
- EvenementService: POST /inscriptions (sans membreId), DELETE /inscriptions, GET /recherche, GET /type/{type}
- MembreService: creer() accepte CreateMembreRequest au lieu de MembreResponse
- Nouveaux services: BackupService, EpargneService, FinanceApprovalService, LogsService, MessageService, OrganisationService, PaiementClientService
Beans:
- MembreInscriptionBean: construit CreateMembreRequest.builder() avec organisationId UUID
- EvenementsBean: inscrireParticipant(id) sans userId (backend infère depuis token)
- DashboardBean: checkAccessAndRedirect() SUPER_ADMIN en premier
Sécurité:
- AuthenticationFilter: gestion AJAX PrimeFaces (partial/ajax → XML partial-response redirect)
- PermissionChecker: vérification rôles côté bean
- k8s/: manifestes secrets SMTP et Wave (placeholders à remplir)
Pages XHTML: dashboards rôles, cotisations, membres, événements, organisations
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package dev.lions.unionflow.client.bean;
|
||||
|
||||
import dev.lions.unionflow.client.view.UserSession;
|
||||
import jakarta.enterprise.context.SessionScoped;
|
||||
import jakarta.inject.Named;
|
||||
import io.quarkus.security.identity.SecurityIdentity;
|
||||
@@ -30,6 +31,9 @@ public class MenuBean implements Serializable {
|
||||
@Inject
|
||||
SecurityIdentity securityIdentity;
|
||||
|
||||
@Inject
|
||||
UserSession userSession;
|
||||
|
||||
/**
|
||||
* Vérifie si l'utilisateur a au moins un des rôles spécifiés.
|
||||
*
|
||||
@@ -548,4 +552,117 @@ public class MenuBean implements Serializable {
|
||||
public boolean isMembreSimple() {
|
||||
return hasAnyRole("MEMBRE_SIMPLE");
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
// MENUS PAR MODULE (conditionnels selon le type d'organisation active)
|
||||
// Chaque méthode combine : rôle requis + module actif dans l'org active.
|
||||
// Un SUPERADMIN voit tout sans restriction de module.
|
||||
// ========================================================================
|
||||
|
||||
/**
|
||||
* Vérifie si un module est actif pour l'organisation courante.
|
||||
* Les SUPER_ADMIN voient tous les modules.
|
||||
*/
|
||||
private boolean hasModule(String module) {
|
||||
if (hasAnyRole("SUPER_ADMIN")) return true;
|
||||
if (userSession == null) return false;
|
||||
return userSession.hasModuleActif(module);
|
||||
}
|
||||
|
||||
/** Menu Tontine — visible si module TONTINE actif + rôle adéquat. */
|
||||
public boolean isTontineMenuVisible() {
|
||||
return hasModule("TONTINE") &&
|
||||
hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER",
|
||||
"TONTINE_RESP", "TONTINE_MANAGER", "TONTINE_COLLECTOR");
|
||||
}
|
||||
|
||||
/** Menu Tontine (membres) — consultation de ses propres tontines. */
|
||||
public boolean isTontineMemberVisible() {
|
||||
return hasModule("TONTINE") && !securityIdentity.isAnonymous();
|
||||
}
|
||||
|
||||
/** Menu Épargne — visible si module EPARGNE actif. */
|
||||
public boolean isEpargneMenuVisible() {
|
||||
return hasModule("EPARGNE") &&
|
||||
hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER",
|
||||
"MUTUELLE_RESP", "EPARGNE_MANAGER");
|
||||
}
|
||||
|
||||
/** Menu Épargne (membres). */
|
||||
public boolean isEpargneMemberVisible() {
|
||||
return hasModule("EPARGNE") && !securityIdentity.isAnonymous();
|
||||
}
|
||||
|
||||
/** Menu Crédit — visible si module CREDIT actif. */
|
||||
public boolean isCreditMenuVisible() {
|
||||
return hasModule("CREDIT") &&
|
||||
hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "TRESORIER",
|
||||
"MUTUELLE_RESP", "CREDIT_ANALYSTE", "RESPONSABLE_CREDIT");
|
||||
}
|
||||
|
||||
/** Menu Crédit (membres). */
|
||||
public boolean isCreditMemberVisible() {
|
||||
return hasModule("CREDIT") && !securityIdentity.isAnonymous();
|
||||
}
|
||||
|
||||
/** Menu Agriculture / Campagnes — visible si module AGRICULTURE actif. */
|
||||
public boolean isAgricoleMenuVisible() {
|
||||
return hasModule("AGRICULTURE") &&
|
||||
hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "COOP_RESP");
|
||||
}
|
||||
|
||||
/** Menu Agriculture (membres). */
|
||||
public boolean isAgricoleMemberVisible() {
|
||||
return hasModule("AGRICULTURE") && !securityIdentity.isAnonymous();
|
||||
}
|
||||
|
||||
/** Menu Collecte de fonds — visible si module COLLECTE_FONDS actif. */
|
||||
public boolean isCollecteFondsMenuVisible() {
|
||||
return hasModule("COLLECTE_FONDS") &&
|
||||
hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "COLLECTE_RESP");
|
||||
}
|
||||
|
||||
/** Menu Projets ONG — visible si module PROJETS_ONG actif. */
|
||||
public boolean isProjetOngMenuVisible() {
|
||||
return hasModule("PROJETS_ONG") &&
|
||||
hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "ONG_RESP", "PROJET_MANAGER");
|
||||
}
|
||||
|
||||
/** Menu Culte / Dons religieux — visible si module CULTE_DONS actif. */
|
||||
public boolean isCulteMenuVisible() {
|
||||
return hasModule("CULTE_DONS") &&
|
||||
hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "CULTE_RESP", "PASTEUR", "DIACRE");
|
||||
}
|
||||
|
||||
/** Menu Vote — visible si module VOTES actif. */
|
||||
public boolean isVoteMenuVisible() {
|
||||
return hasModule("VOTES") &&
|
||||
hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "VOTE_RESP", "SCRUTATEUR");
|
||||
}
|
||||
|
||||
/** Menu Registre / Agrément — visible si module REGISTRE_AGREMENT actif. */
|
||||
public boolean isRegistreAgrementMenuVisible() {
|
||||
return hasModule("REGISTRE_AGREMENT") &&
|
||||
hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION", "REGISTRE_RESP");
|
||||
}
|
||||
|
||||
/** Menu Gouvernance / Organigramme — visible si module GOUVERNANCE actif. */
|
||||
public boolean isGouvernanceMenuVisible() {
|
||||
return hasModule("GOUVERNANCE") &&
|
||||
hasAnyRole("SUPER_ADMIN", "ADMIN_ORGANISATION");
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne true si l'organisation active dispose d'au moins un module métier spécifique
|
||||
* (au-delà des modules communs toujours disponibles).
|
||||
* Utilisé pour afficher/masquer la section "Modules métier" dans la navigation.
|
||||
*/
|
||||
public boolean hasAnyBusinessModule() {
|
||||
if (hasAnyRole("SUPER_ADMIN")) return true;
|
||||
return isTontineMenuVisible() || isCreditMenuVisible() || isEpargneMenuVisible()
|
||||
|| isAgricoleMenuVisible() || isCollecteFondsMenuVisible()
|
||||
|| isProjetOngMenuVisible() || isCulteMenuVisible()
|
||||
|| isVoteMenuVisible() || isRegistreAgrementMenuVisible()
|
||||
|| isGouvernanceMenuVisible();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user