Correction 'indexOf'

This commit is contained in:
xdrm-brackets 2016-07-19 19:49:46 +02:00
parent b4023e83a1
commit c4d60c4c57
1 changed files with 1 additions and 9 deletions

View File

@ -363,15 +363,7 @@
for( var a in Object.keys(ACTIONS[COUNT]) ){ for( var a in Object.keys(ACTIONS[COUNT]) ){
/* (3) On vérifie que l'utilisateur a la permissions d'effectuer l'action */ /* (3) On vérifie que l'utilisateur a la permissions d'effectuer l'action */
var hasPermission = false; var hasPermission = PERMISSIONS.hasOwnProperty(CARD) && PERMISSIONS[CARD].indexOf( ACTIONS[COUNT][a].id_action.toString() ) > -1;
// 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;
}
// Si on a pas la permission, on quitte // Si on a pas la permission, on quitte
if( !hasPermission ) continue; if( !hasPermission ) continue;