Commit 1177baee authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Ajout de privilege

parent a7ca7158
Loading
Loading
Loading
Loading
+17 −0
Changes for module/UnicaenDocument/view/unicaen-document/contenu/index.phtml: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -6,6 +6,13 @@
 */

use UnicaenDocument\Entity\Db\Content;
use UnicaenDocument\Provider\Privilege\DocumentcontentPrivileges;

$canAjouter  = $this->isAllowed(DocumentcontentPrivileges::getResourceId(DocumentcontentPrivileges::DOCUMENTCONTENU_AJOUTER));
$canAfficher  = $this->isAllowed(DocumentcontentPrivileges::getResourceId(DocumentcontentPrivileges::DOCUMENTCONTENU_INDEX));
$canModifier = $this->isAllowed(DocumentcontentPrivileges::getResourceId(DocumentcontentPrivileges::DOCUMENTCONTENU_MODIFIER));
$canHistoriser = $this->isAllowed(DocumentcontentPrivileges::getResourceId(DocumentcontentPrivileges::DOCUMENTCONTENU_HISTORISER));
$canDetruire = $this->isAllowed(DocumentcontentPrivileges::getResourceId(DocumentcontentPrivileges::DOCUMENTCONTENU_SUPPRIMER));

$this->headTitle("Index des contenus");
?>
@@ -16,11 +23,13 @@ $this->headTitle("Index des contenus");

<div class="main">

    <?php if ($canAjouter) : ?>
        <a href="<?php echo $this->url('contenu/contenu/ajouter', [], [], true); ?>"
           class="btn btn-primary action ajax-modal" data-event="modification">
            <span class="icon ajouter"></span>
            Ajouter un contenu
        </a>
    <?php endif; ?>

    <table class="table table-condensed">
        <thead>
@@ -43,14 +52,19 @@ $this->headTitle("Index des contenus");
                        <?php echo $contenu->getType(); ?>
                    </td>
                    <td>
                        <?php if ($canAfficher) : ?>
                            <a href="<?php echo $this->url('contenu/contenu/afficher', ['contenu' => $contenu->getId()], [], true); ?>"
                               class="ajax-modal"
                            >
                                <span class="icon voir"></span></a>
                        <?php endif; ?>
                        <?php if ($canModifier) : ?>
                            <a href="<?php echo $this->url('contenu/contenu/modifier', ['contenu' => $contenu->getId()], [], true); ?>"
                               class="ajax-modal" data-event="modification"
                            >
                                <span class="icon editer"></span></a>
                        <?php endif; ?>
                        <?php if ($canHistoriser) : ?>
                            <?php if ($contenu->estNonHistorise()) : ?>
                                <a href="<?php echo $this->url('contenu/contenu/historiser', ['contenu' => $contenu->getId()], [], true); ?>"
                                >
@@ -60,10 +74,13 @@ $this->headTitle("Index des contenus");
                                >
                                    <span class="icon restaurer"></span></a>
                            <?php endif; ?>
                        <?php endif; ?>
                        <?php if ($canDetruire) : ?>
                            <a href="<?php echo $this->url('contenu/contenu/detruire', ['contenu' => $contenu->getId()], [], true); ?>"
                               class="ajax-modal" data-event="modification"
                            >
                                <span class="icon detruire"></span></a>
                        <?php endif; ?>
                    </td>
                </tr>
            <?php endforeach; ?>