testfix permission (authdefault)

This commit is contained in:
xdrm-brackets 2017-09-25 23:52:53 +02:00
parent 352dfdc995
commit a14d9c4da0
1 changed files with 3 additions and 3 deletions

View File

@ -232,17 +232,17 @@
/* (1) Si entrepot requis, mais manquant /* (1) Si entrepot requis, mais manquant
---------------------------------------------------------*/ ---------------------------------------------------------*/
if( in_array('warehouse', $expected) && self::auth() < 1 ) if( in_array('warehouse', $expected) && !isset($_SESSION['WAREHOUSE']['id']) )
return Err::PermissionError; return Err::PermissionError;
/* (2) Si admin requis, mais manquant /* (2) Si admin requis, mais manquant
---------------------------------------------------------*/ ---------------------------------------------------------*/
if( in_array('admin', $expected) && self::auth() != 2 ) if( in_array('admin', $expected) && !isset($_SESSION['ADMIN']['id']) )
return Err::PermissionError; return Err::PermissionError;
/* (3) Si SATS requis, mais manquant /* (3) Si SATS requis, mais manquant
---------------------------------------------------------*/ ---------------------------------------------------------*/
if( in_array('sats', $expected) && self::auth() < 3 ) if( in_array('sats', $expected) && !isset($_SESSION['SATS']['id']) )
return Err::TokenError; return Err::TokenError;
/* (4) On retire 'warehouse', 'admin' et 'sats' de @expected /* (4) On retire 'warehouse', 'admin' et 'sats' de @expected