revert user role change

This commit is contained in:
isUnknown 2025-01-20 15:07:44 +01:00
parent 3f8c185ee0
commit 8a2b90c8c0
4 changed files with 33 additions and 39 deletions

View file

@ -1,38 +0,0 @@
<?php
$directory = __DIR__ . '/../../site/accounts';
foreach (glob($directory . '/*/index.php') as $filePath) {
$data = include $filePath;
if (is_array($data) && array_key_exists('role', $data)) {
switch ($data["role"]) {
case "client":
$newRoleValue = "0_client";
break;
case "pochet":
$newRoleValue = "1_pochet";
break;
case NULL:
$newRoleValue = "admin";
break;
}
if (isset($newRoleValue)) {
$data['role'] = $newRoleValue;
$exportedData = "<?php\n\nreturn " . var_export($data, true) . ";\n";
file_put_contents($filePath, $exportedData);
echo "Fichier modifié : $filePath\n";
} else {
echo "Fichier ignoré ou format inattendu : $filePath\n";
}
} else {
echo "Fichier ignoré ou format inattendu : $filePath\n";
}
}
echo "Modification terminée.\n";

View file

@ -0,0 +1,11 @@
title: Client
description: Ne peut pas accéder au Panel, peut accéder aux Projets auxquels il est assigné côté front.
permissions:
access:
panel: false
fields:
projects:
label: Projets
type: pages
query: page('projects').children

View file

@ -0,0 +1,21 @@
title: Interne Pochet
description: Peux accéder au Panel mais pas aux Utilisateurs, peut accéder aux Projets auxquels il est assigné par un Admin.
home: /panel/pages/projects
permissions:
access:
users: false
fields:
job:
label: Métier
type: select
options:
- Project Manager
- Sales Manager
default: Project Panager
width: 1/4
projects:
label: Projets
type: pages
query: page('projects').children
width: 3/4