Correction 'indexOf'

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

View File

@ -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;