Added module 'authenticationDefault/get_admins' to fetch all admins of the warehouse

This commit is contained in:
xdrm-brackets 2017-11-07 12:16:13 +01:00
parent a5b22a4836
commit 6b123765b6
3 changed files with 33 additions and 0 deletions

View File

@ -122,7 +122,30 @@
/* RETOURNE LA LISTE DSE ADMINISTRATEURS DE L'ENTREPOT
*
* @return admins<array> Liste des administrateurs de l'entrepôt
*
*/
public function get_admins($params){
/* (1) Fetch admin list
---------------------------------------------------------*/
/* (1) Prepare request */
$listRq = new Repo('admin/getByIdWarehouse', [ $_SESSION['WAREHOUSE']['id'] ]);
/* (2) Get response */
$listRs = $listRq->answer();
/* (3) Manage error */
if( !is_array($listRs) )
return ['error' => new Error(Err::RepoError)];
/* (2) Setup data (remove self)
---------------------------------------------------------*/
return ['admins' => $listRs];
}

View File

@ -61,6 +61,15 @@
}
},
"POST::get_admins": {
"description": "Retourne la liste des administrateurs de l'entrepôt.",
"permissions": [["admin"]],
"parameters": {},
"output": {
"admin": { "description": "Liste des administrateur.", "type": "array" }
}
},
"POST::update_admin": {
"description": "Changement de mot de passe administrateur",
"permissions": [["admin"]],

View File

@ -160,6 +160,7 @@
"getAll",
"getById",
"getByUsername",
"getByIdWarehouse",
"getByMail",
"getByToken",