Gestion de l'affichage de "settings" uniquement si on est "admin"

This commit is contained in:
xdrm-brackets 2016-04-12 15:37:17 +02:00
parent 3bb6c0802b
commit 4211fb9160
2 changed files with 65 additions and 53 deletions

View File

@ -98,11 +98,15 @@
<span data-link='analytics' ><?= ResourceDispatcher::getResource('f/svg/analytics/st/menu-side'); ?>Statistiques</span> <span data-link='analytics' ><?= ResourceDispatcher::getResource('f/svg/analytics/st/menu-side'); ?>Statistiques</span>
<span data-link='charts' class='sep'><?= ResourceDispatcher::getResource('f/svg/charts/st/menu-side'); ?>Visualisation</span> <span data-link='charts' class='sep'><?= ResourceDispatcher::getResource('f/svg/charts/st/menu-side'); ?>Visualisation</span>
<?php if( permission('admin') ){ ?>
<span data-link='settings' ><?= ResourceDispatcher::getResource('f/svg/settings/st/menu-side' ); ?>Paramètres</span> <span data-link='settings' ><?= ResourceDispatcher::getResource('f/svg/settings/st/menu-side' ); ?>Paramètres</span>
<div class='sub'> <div class='sub'>
<span data-sublink='tokens'>Gestion des tokens</span> <span data-sublink='tokens'>Gestion des tokens</span>
<span data-sublink='users'>Gestion des utilisateurs</span> <span data-sublink='users'>Gestion des utilisateurs</span>
</div> </div>
<?php } ?>
</nav> </nav>

View File

@ -8,13 +8,19 @@
/* [1] On recupere les tokens
/* [1] Gestion des tokens
=========================================================*/ =========================================================*/
// permission: admin
//=======================================================//
/* (1) On recupere la liste des tokens */
$req_tokens = new Repo('token/getAll'); $req_tokens = new Repo('token/getAll');
$tokens = $req_tokens->answer(); $tokens = $req_tokens->answer();
?>
/* (2) Gestion des droits */
if( permission('admin') ){ ?>
<section data-sublink='tokens'> <section data-sublink='tokens'>
@ -69,6 +75,8 @@ $tokens = $req_tokens->answer();
</section> </section>
</section> </section>
<?php } ?>
<section data-sublink='users'> <section data-sublink='users'>
Gestion des utilisateurs Gestion des utilisateurs
</section> </section>