diff --git a/test/client/interface.php b/test/client/interface.php index 7b0ad13..39f3d27 100644 --- a/test/client/interface.php +++ b/test/client/interface.php @@ -363,15 +363,7 @@ for( var a in Object.keys(ACTIONS[COUNT]) ){ /* (3) On vérifie que l'utilisateur a la permissions d'effectuer l'action */ - var hasPermission = false; - - // On vérifie parmis toutes les permissions de cette CARTE - if( PERMISSIONS.hasOwnProperty(CARD) ) - for( var i = 0 ; i < PERMISSIONS[CARD].length ; i++ ) - if( PERMISSIONS[CARD][i] == ACTIONS[COUNT][a].id_action ){ - hasPermission = true; - break; - } + var hasPermission = PERMISSIONS.hasOwnProperty(CARD) && PERMISSIONS[CARD].indexOf( ACTIONS[COUNT][a].id_action.toString() ) > -1; // Si on a pas la permission, on quitte if( !hasPermission ) continue;