Fonctionnement des droits avec les services, retourne une array plutot qu'une chaine de caractère
This commit is contained in:
parent
a876608cb3
commit
574392b6c2
@ -574,11 +574,18 @@ class Scores_Ws_Server
|
||||
*/
|
||||
protected function checkPerm($perm)
|
||||
{
|
||||
$droits = $this->User->droits;
|
||||
$output = false;
|
||||
if ( preg_match('/\b'.$perm.'\b/i', $droits) ){
|
||||
$output = true;
|
||||
$droits = $this->User->droits;
|
||||
if ( is_array($droits) ) {
|
||||
if ( in_array($perm, $droits) ){
|
||||
$output = true;
|
||||
}
|
||||
} else {
|
||||
if ( preg_match('/\b'.$perm.'\b/i', $droits) ){
|
||||
$output = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,12 @@ class Gestion extends Scores_Ws_Server
|
||||
$result->dateValidation = $this->User->dateValidation;
|
||||
$result->nombreConnexions = $this->User->nombreConnexions;
|
||||
$result->dateDerniereConnexion = $this->User->dateDerniereConnexion;
|
||||
$result->droits = $this->User->droits;
|
||||
// v2 auth return an array
|
||||
if ( is_array($this->User->droits) ) {
|
||||
$result->droits = join(' ', $this->User->droits);
|
||||
} else {
|
||||
$result->droits = $this->User->droits;
|
||||
}
|
||||
$result->droitsClients = $this->User->droitsClients;
|
||||
$result->timeout = $this->User->timeout;
|
||||
$result->clientTest = $this->User->clientTest;
|
||||
|
Loading…
Reference in New Issue
Block a user