Commit 51f170c9 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Retour en arrière suite à l'abandon des modifs envisagées sur unicaen/auth (trop compliqué)

parent 8f008b83
Pipeline #11763 passed with stage
in 21 seconds
......@@ -108,31 +108,31 @@ return [
'unicaen-db-import' => [
'label' => "Import/Synchro",
'route' => 'unicaen-db-import/import',
'resource' => ImportPrivilege::resourceIdForPrivilege(ImportPrivilege::LISTER),
'resource' => ImportPrivilege::getResourceId(ImportPrivilege::LISTER),
'order' => 100,
'pages' => [
'import' => [
'label' => "Imports",
'route' => 'unicaen-db-import/import',
'resource' => ImportPrivilege::resourceIdForPrivilege(ImportPrivilege::LISTER),
'resource' => ImportPrivilege::getResourceId(ImportPrivilege::LISTER),
'order' => 10,
],
'synchro' => [
'label' => "Synchros",
'route' => 'unicaen-db-import/synchro',
'resource' => SynchroPrivilege::resourceIdForPrivilege(SynchroPrivilege::LISTER),
'resource' => SynchroPrivilege::getResourceId(SynchroPrivilege::LISTER),
'order' => 20,
],
'log' => [
'label' => "Logs",
'route' => 'unicaen-db-import/log',
'resource' => LogPrivilege::resourceIdForPrivilege(LogPrivilege::LISTER),
'resource' => LogPrivilege::getResourceId(LogPrivilege::LISTER),
'order' => 30,
],
'observ' => [
'label' => "Observations",
'route' => 'unicaen-db-import/observ',
'resource' => ObservationPrivilege::resourceIdForPrivilege(ObservationPrivilege::LISTER),
'resource' => ObservationPrivilege::getResourceId(ObservationPrivilege::LISTER),
'order' => 40,
],
],
......
......@@ -2,12 +2,10 @@
namespace UnicaenDbImport\Privilege;
use UnicaenAuth\Provider\Privilege\PrivilegeAsResourceTrait;
use UnicaenAuth\Provider\Privilege\Privileges;
class ImportPrivilege
class ImportPrivilege extends Privileges
{
use PrivilegeAsResourceTrait;
const LISTER = 'unicaen-db-import-import-lister';
const CONSULTER = 'unicaen-db-import-import-consulter';
const LANCER = 'unicaen-db-import-import-lancer';
......
......@@ -2,12 +2,10 @@
namespace UnicaenDbImport\Privilege;
use UnicaenAuth\Provider\Privilege\PrivilegeAsResourceTrait;
use UnicaenAuth\Provider\Privilege\Privileges;
class LogPrivilege
class LogPrivilege extends Privileges
{
use PrivilegeAsResourceTrait;
const LISTER = 'unicaen-db-import-log-lister';
const CONSULTER = 'unicaen-db-import-log-consulter';
}
\ No newline at end of file
......@@ -2,12 +2,10 @@
namespace UnicaenDbImport\Privilege;
use UnicaenAuth\Provider\Privilege\PrivilegeAsResourceTrait;
use UnicaenAuth\Provider\Privilege\Privileges;
class ObservationPrivilege
class ObservationPrivilege extends Privileges
{
use PrivilegeAsResourceTrait;
const LISTER = 'unicaen-db-import-observation-lister';
const CONSULTER_RESULTAT = 'unicaen-db-import-observation-consulter-resultat';
}
\ No newline at end of file
......@@ -2,12 +2,10 @@
namespace UnicaenDbImport\Privilege;
use UnicaenAuth\Provider\Privilege\PrivilegeAsResourceTrait;
use UnicaenAuth\Provider\Privilege\Privileges;
class SynchroPrivilege
class SynchroPrivilege extends Privileges
{
use PrivilegeAsResourceTrait;
const LISTER = 'unicaen-db-import-synchro-lister';
const CONSULTER = 'unicaen-db-import-synchro-consulter';
const LANCER = 'unicaen-db-import-synchro-lancer';
......
......@@ -10,8 +10,8 @@ use UnicaenDbImport\Privilege\ImportPrivilege;
$this->headTitle($this->translate("Imports"));
$consultable = $this->isAllowed(ImportPrivilege::resourceIdForPrivilege(ImportPrivilege::CONSULTER));
$lancable = $this->isAllowed(ImportPrivilege::resourceIdForPrivilege(ImportPrivilege::LANCER));
$consultable = $this->isAllowed(ImportPrivilege::getResourceId(ImportPrivilege::CONSULTER));
$lancable = $this->isAllowed(ImportPrivilege::getResourceId(ImportPrivilege::LANCER));
?>
<h1 class="page-header">
......
......@@ -11,7 +11,7 @@ use UnicaenDbImport\Privilege\ImportPrivilege;
$this->headTitle($this->translate("Import") . ' ' . $import->getName());
$lancable = $this->isAllowed(ImportPrivilege::resourceIdForPrivilege(ImportPrivilege::LANCER));
$lancable = $this->isAllowed(ImportPrivilege::getResourceId(ImportPrivilege::LANCER));
?>
<h1 class="page-header">
......
......@@ -12,8 +12,8 @@ use UnicaenDbImport\Privilege\SynchroPrivilege;
$this->headTitle($this->translate("Logs"));
$importConsultable = $this->isAllowed(ImportPrivilege::resourceIdForPrivilege(ImportPrivilege::CONSULTER));
$synchroConsultable = $this->isAllowed(SynchroPrivilege::resourceIdForPrivilege(SynchroPrivilege::CONSULTER));
$importConsultable = $this->isAllowed(ImportPrivilege::getResourceId(ImportPrivilege::CONSULTER));
$synchroConsultable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::CONSULTER));
?>
<h1 class="page-header">
......@@ -85,7 +85,7 @@ $synchroConsultable = $this->isAllowed(SynchroPrivilege::resourceIdForPrivilege(
<span class="fas <?php echo $log->isSuccess() ? 'fa-thumbs-up text-success' : 'fa-thumbs-down text-danger' ?>"></span>
</td>
<td>
<?php if ($this->isAllowed(LogPrivilege::resourceIdForPrivilege(LogPrivilege::CONSULTER))): ?>
<?php if ($this->isAllowed(LogPrivilege::getResourceId(LogPrivilege::CONSULTER))): ?>
<?php
$fullLog = str_replace(PHP_EOL, '<br>', $log->getLog());
$truncLog = mb_strlen($log->getLog()) > 150 ?
......
......@@ -10,7 +10,7 @@ use UnicaenDbImport\Privilege\ObservationPrivilege;
$this->headTitle($this->translate("Observations"));
$resultatConsultable = $this->isAllowed(ObservationPrivilege::resourceIdForPrivilege(ObservationPrivilege::CONSULTER_RESULTAT));
$resultatConsultable = $this->isAllowed(ObservationPrivilege::getResourceId(ObservationPrivilege::CONSULTER_RESULTAT));
?>
<h1 class="page-header">
......
......@@ -15,7 +15,7 @@ use UnicaenDbImport\Privilege\SynchroPrivilege;
$this->headTitle($this->translate("Synchro") . ' ' . $synchro->getName());
$lancable = $this->isAllowed(SynchroPrivilege::resourceIdForPrivilege(SynchroPrivilege::LANCER));
$lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::LANCER));
?>
<h1 class="page-header">
......
......@@ -12,8 +12,8 @@ use UnicaenDbImport\Privilege\SynchroPrivilege;
$this->headTitle($this->translate("Synchros"));
$consultable = $this->isAllowed(SynchroPrivilege::resourceIdForPrivilege(SynchroPrivilege::CONSULTER));
$lancable = $this->isAllowed(SynchroPrivilege::resourceIdForPrivilege(SynchroPrivilege::LANCER));
$consultable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::CONSULTER));
$lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::LANCER));
?>
<h1 class="page-header">
......
......@@ -12,7 +12,7 @@ use UnicaenDbImport\Privilege\SynchroPrivilege;
$this->headTitle($this->translate("Synchro") . ' ' . $synchro->getName());
$lancable = $this->isAllowed(SynchroPrivilege::resourceIdForPrivilege(SynchroPrivilege::LANCER));
$lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::LANCER));
//$hash = $this->queryParams()[]
?>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment