Fixed AuthSystem with default class name assignation
This commit is contained in:
parent
8d85764542
commit
aa105431e2
|
@ -462,15 +462,20 @@
|
||||||
|
|
||||||
/* [2] Vérification des permissions et de l'authentification
|
/* [2] Vérification des permissions et de l'authentification
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
var_dump(self::$authsystem);
|
// if no AuthSystem set up, use the default one
|
||||||
die('error line 466');
|
if( !self::$authsystem instanceof AuthSystem ){
|
||||||
// if no AuthSystem set up, deny by default
|
|
||||||
//if( !self::$authsystem instanceof AuthSystem )
|
// try to load default AuthSystem
|
||||||
// return false;
|
if( !file_exists(__BUILD__.'/api/core/AuthSystemDefault.php') )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// load default AuthSystem class
|
||||||
|
$classname = '\\api\\core\\AuthSystemDefault';
|
||||||
|
self::$authsystem = new $classname();
|
||||||
|
}
|
||||||
|
|
||||||
// Check permission using user-implemented AuthSystem
|
// Check permission using user-implemented AuthSystem
|
||||||
$granted = self::$authsystem::permission();
|
$granted = self::$authsystem::permission( $this->path['module'], $method['permissions'] );
|
||||||
//$granted = self::$authsystem::permission( $this->path['module'], $method['permissions'] );
|
|
||||||
|
|
||||||
/* (1) On retourne FAUX si aucun droit n'a ete trouve */
|
/* (1) On retourne FAUX si aucun droit n'a ete trouve */
|
||||||
if( $granted->get() !== Err::Success ){
|
if( $granted->get() !== Err::Success ){
|
||||||
|
|
|
@ -44,7 +44,6 @@
|
||||||
$request = new Request('machineDefault/getClusters', [
|
$request = new Request('machineDefault/getClusters', [
|
||||||
'id_machine' => (int) $id_machine
|
'id_machine' => (int) $id_machine
|
||||||
]);
|
]);
|
||||||
var_dump('r2 - machine/view.php:47', $request->error->get());
|
|
||||||
|
|
||||||
$answer = $request->dispatch();
|
$answer = $request->dispatch();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue