Loading admin/src/DataGen.php −15 Changes for admin/src/DataGen.php: 0 added lines, 15 removed lines. Original line number Diff line number Diff line Loading @@ -397,21 +397,6 @@ class DataGen } } /* L'administrateur doit avoir tous les droits obligatoirement! */ $this->logMsg('Attribution de tous les droits au rôle Administrateur ...', true); $this->oseAdmin->getBdd()->exec(" INSERT INTO ROLE_PRIVILEGE(PRIVILEGE_ID, ROLE_ID) SELECT P.ID PRIVILEGE_ID, R.ID ROLE_ID FROM PRIVILEGE P JOIN ROLE R ON R.CODE = 'administrateur' LEFT JOIN ROLE_PRIVILEGE RP ON RP.PRIVILEGE_ID = P.ID AND RP.ROLE_ID = R.ID WHERE RP.ROLE_ID IS NULL "); $this->logMsg('Mise à jour du point d\'indice pour les HETD ...', true); $this->oseAdmin->getBdd()->exec('BEGIN OSE_FORMULE.UPDATE_ANNEE_TAUX_HETD; END;'); $this->logEnd(); Loading module/Application/src/Service/PrivilegeService.php +8 −6 Changes for module/Application/src/Service/PrivilegeService.php: 8 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Application\Service; use Application\Entity\Db\Annee; use Application\Entity\Db\Role; use Application\Service\Traits\ContextServiceAwareTrait; use Intervenant\Entity\Db\Statut; Loading Loading @@ -46,6 +47,13 @@ class PrivilegeService extends \UnicaenAuth\Service\PrivilegeService { $privilegesRoles = []; /* L'administrateur a tous les privilèges obligatoirement */ $rc = new \ReflectionClass(\Application\Provider\Privilege\Privileges::class); $privileges = array_values($rc->getConstants()); foreach ($privileges as $privilege) { $privilegesRoles[$privilege] = [Role::ADMINISTRATEUR]; } $sql = " SELECT cp.code || '-' || p.code privilege, Loading @@ -60,9 +68,6 @@ class PrivilegeService extends \UnicaenAuth\Service\PrivilegeService while ($pr = $query->fetchAssociative()) { $privilege = $pr['PRIVILEGE']; $role = $pr['ROLE']; if (!array_key_exists($privilege, $privilegesRoles)) { $privilegesRoles[$privilege] = []; } $privilegesRoles[$privilege][] = $role; } Loading @@ -74,9 +79,6 @@ class PrivilegeService extends \UnicaenAuth\Service\PrivilegeService $sp = $statut->getPrivileges(); foreach ($sp as $privilege => $has) { if ($has) { if (!array_key_exists($privilege, $privilegesRoles)) { $privilegesRoles[$privilege] = []; } $privilegesRoles[$privilege][] = $statut->getRoleId(); } } Loading Loading
admin/src/DataGen.php −15 Changes for admin/src/DataGen.php: 0 added lines, 15 removed lines. Original line number Diff line number Diff line Loading @@ -397,21 +397,6 @@ class DataGen } } /* L'administrateur doit avoir tous les droits obligatoirement! */ $this->logMsg('Attribution de tous les droits au rôle Administrateur ...', true); $this->oseAdmin->getBdd()->exec(" INSERT INTO ROLE_PRIVILEGE(PRIVILEGE_ID, ROLE_ID) SELECT P.ID PRIVILEGE_ID, R.ID ROLE_ID FROM PRIVILEGE P JOIN ROLE R ON R.CODE = 'administrateur' LEFT JOIN ROLE_PRIVILEGE RP ON RP.PRIVILEGE_ID = P.ID AND RP.ROLE_ID = R.ID WHERE RP.ROLE_ID IS NULL "); $this->logMsg('Mise à jour du point d\'indice pour les HETD ...', true); $this->oseAdmin->getBdd()->exec('BEGIN OSE_FORMULE.UPDATE_ANNEE_TAUX_HETD; END;'); $this->logEnd(); Loading
module/Application/src/Service/PrivilegeService.php +8 −6 Changes for module/Application/src/Service/PrivilegeService.php: 8 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Application\Service; use Application\Entity\Db\Annee; use Application\Entity\Db\Role; use Application\Service\Traits\ContextServiceAwareTrait; use Intervenant\Entity\Db\Statut; Loading Loading @@ -46,6 +47,13 @@ class PrivilegeService extends \UnicaenAuth\Service\PrivilegeService { $privilegesRoles = []; /* L'administrateur a tous les privilèges obligatoirement */ $rc = new \ReflectionClass(\Application\Provider\Privilege\Privileges::class); $privileges = array_values($rc->getConstants()); foreach ($privileges as $privilege) { $privilegesRoles[$privilege] = [Role::ADMINISTRATEUR]; } $sql = " SELECT cp.code || '-' || p.code privilege, Loading @@ -60,9 +68,6 @@ class PrivilegeService extends \UnicaenAuth\Service\PrivilegeService while ($pr = $query->fetchAssociative()) { $privilege = $pr['PRIVILEGE']; $role = $pr['ROLE']; if (!array_key_exists($privilege, $privilegesRoles)) { $privilegesRoles[$privilege] = []; } $privilegesRoles[$privilege][] = $role; } Loading @@ -74,9 +79,6 @@ class PrivilegeService extends \UnicaenAuth\Service\PrivilegeService $sp = $statut->getPrivileges(); foreach ($sp as $privilege => $has) { if ($has) { if (!array_key_exists($privilege, $privilegesRoles)) { $privilegesRoles[$privilege] = []; } $privilegesRoles[$privilege][] = $statut->getRoleId(); } } Loading