auth upgrade

This commit is contained in:
xdrm-brackets 2016-11-08 10:37:29 +01:00
parent 7880651c5d
commit 569d594c82
2 changed files with 10 additions and 5 deletions

View File

@ -105,8 +105,8 @@
file_put_contents($fn, $GLOBALS['TOKEN']); file_put_contents($fn, $GLOBALS['TOKEN']);
/* (5) Stores permission */ /* (5) Stores permission */
if( !in_array('cyclic-hash-system', $GLOBALS['PERM']) ) if( !in_array('cyclic-hash', $GLOBALS['PERM']) )
$GLOBALS['PERM'][] = 'cyclic-hash-system'; $GLOBALS['PERM'][] = 'cyclic-hash';
/* [3] Returns true if no error /* [3] Returns true if no error
@ -127,8 +127,13 @@
* *
*/ */
public static function permission($module, $expected){ public static function permission($module, $expected){
/* [1] Mise à jour de l'authentification /* [1] Setup
=========================================================*/ =========================================================*/
/* (1) If no expected, return true */
if( !is_array($expected) || count($expected) === 0 )
return true;
/* (2) Mise à jour de l'authentification */
self::check(); self::check();

View File

@ -3,7 +3,7 @@
"authentification": { "authentification": {
"renew": { "renew": {
"description": "Renewal of the cyclic hashing system.", "description": "Renewal of the cyclic hashing system.",
"permission": ["cyclic-hash-system"], "permission": ["cyclic-hash"],
"parameters": { "parameters": {
"hash": { "description": "new hash to store.", "type": "hash" } "hash": { "description": "new hash to store.", "type": "hash" }
} }
@ -14,7 +14,7 @@
"release": { "release": {
"pull": { "pull": {
"description": "Pulls project from git branch.", "description": "Pulls project from git branch.",
"permissions": ["cyclic-hash-system"], "permissions": ["cyclic-hash"],
"parameters": { "parameters": {
"project": { "description": "Project's name.", "type": "varchar(2,30,alphanumeric)" }, "project": { "description": "Project's name.", "type": "varchar(2,30,alphanumeric)" },
"branch": { "description": "Git release branch.", "type": "varchar(2,30,alphanumeric)" } "branch": { "description": "Git release branch.", "type": "varchar(2,30,alphanumeric)" }