Files
ms1inscription-v5/sql/MSIN-eve-acces-v2-phase3-role-delegable.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

31 lines
968 B
SQL

/*
MSIN - Acces evenement v2 (phase 3) - role_delegable pour kits promoteur
Executer APRES phase 1 + phase 2 (+ bib-qr seed si applicable).
*/
SET NAMES utf8mb4;
/* Ajout idempotent : n'ajoute la colonne que si elle n'existe pas deja
(evite l'erreur 1060 - Duplicate column name si le script est relance). */
SET @col_exists := (
SELECT COUNT(*) FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'inscriptions_eve_roles'
AND COLUMN_NAME = 'role_delegable'
);
SET @ddl := IF(@col_exists = 0,
'ALTER TABLE `inscriptions_eve_roles` ADD COLUMN `role_delegable` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT ''Proposable par le promoteur lors d invitations equipe'' AFTER `role_systeme`',
'DO 0');
PREPARE stmt FROM @ddl;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
UPDATE `inscriptions_eve_roles`
SET `role_delegable` = 1
WHERE `role_code` IN (
'gestion_ops',
'gestion_readonly',
'gestion_statut',
'bib_ops'
);