Files
ms1inscription-v5/sql/MSIN-eve-acces-v2-phase1-pilot-example.sql
stephan f1e43c911b Update access permissions from 'inscriptions_mobile' to 'inscriptions_gestion' across multiple files
This commit refactors the access control logic to replace references to 'inscriptions_mobile' with 'inscriptions_gestion', aligning the permission structure with the new management system. Changes include updates to SQL scripts, PHP functions, and documentation comments to ensure consistency in permission handling for event management. This enhances clarity and maintains the integrity of the access control system.
2026-06-26 14:16:09 -04:00

62 lines
1.6 KiB
SQL

/*
MSIN - Acces evenement v2 - Exemple pilote (MANUEL)
NE PAS executer tel quel : remplacer com_id et eve_id.
Executer UN bloc a la fois dans votre client SQL.
*/
/*
Etape A - Verifications
SELECT com_id, com_courriel FROM inscriptions_comptes WHERE com_courriel = 'pilote@example.com';
SELECT eve_id, eve_nom_fr FROM inscriptions_evenements WHERE eve_id = 1234;
SELECT role_id, role_code, role_label_fr FROM inscriptions_eve_roles WHERE role_actif = 1;
*/
/*
Etape B - Acces pilote gestion inscriptions 30 jours
INSERT INTO inscriptions_eve_acces
(com_id, eve_id, role_id, ea_statut, ea_expires_at, ea_expire_days, ea_granted_by, ea_note)
SELECT
15464,
1234,
r.role_id,
'actif',
DATE_ADD(NOW(), INTERVAL 30 DAY),
30,
1,
'Pilote prod - gestion inscriptions v2'
FROM inscriptions_eve_roles r
WHERE r.role_code = 'gestion_ops'
LIMIT 1;
*/
/*
Etape C - Validation
SELECT * FROM v_eve_acces_actif WHERE com_id = 15464;
SELECT * FROM v_eve_acces_permissions WHERE com_id = 15464 AND eve_id = 1234;
SELECT com_id, com_eve_promoteur FROM inscriptions_comptes WHERE com_id = 15464;
*/
/*
Etape D - Revocation (sans toucher au legacy)
UPDATE inscriptions_eve_acces
SET ea_statut = 'revoke',
ea_revoked_at = NOW(),
ea_revoked_by = 1
WHERE com_id = 15464 AND eve_id = 1234;
INSERT INTO inscriptions_eve_acces_log
(ea_id, com_id, eve_id, role_id, log_action, log_detail, log_by_com_id)
SELECT ea_id, com_id, eve_id, role_id, 'revoke', 'Revoke manuel - fin pilote', 1
FROM inscriptions_eve_acces
WHERE com_id = 15464 AND eve_id = 1234;
*/