Guest User

Untitled

a guest
Jul 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. $permissions = array (
  2.     'moduleAjouter' => array (
  3.         'general' => 1,
  4.         'admin' => 2,
  5.         'BigBoss' => 4
  6.     ),
  7.     'moduleModifier' => array (
  8.         '...' => 1,
  9.         '...' => 2,
  10.         '...' => 4
  11.     )
  12. );
  13.  
  14. if ($user->hasPermission($moduleAjouter['general']))
  15. {
  16.  
  17.     // affiche XXX
  18.    
  19.     if ($user->hasPermission($moduleAjouter['admin']))
  20.     {
  21.         // Affiche du surplus
  22.  
  23.         if ($user->hasPermission($moduleAjouter['BigBoss'])
  24.         {
  25.             // Affiche le truc du big boss..
  26.         }
  27.     }
  28. }
Add Comment
Please, Sign In to add comment