client+server: switch to yaml config

This commit is contained in:
rr-
2016-04-06 20:38:45 +02:00
parent 19a357611b
commit 55cc7b59e4
18 changed files with 201 additions and 179 deletions

View File

@ -48,7 +48,7 @@ class Api {
continue;
}
const rankName = config.privileges[privilege];
const rankIndex = config.service.userRanks.indexOf(rankName);
const rankIndex = config.ranks.indexOf(rankName);
if (minViableRank === null || rankIndex < minViableRank) {
minViableRank = rankIndex;
}
@ -57,7 +57,7 @@ class Api {
console.error('Bad privilege name: ' + lookup);
}
let myRank = this.user !== null ?
config.service.userRanks.indexOf(this.user.accessRank) :
config.ranks.indexOf(this.user.rank) :
0;
return myRank >= minViableRank;
}
@ -91,7 +91,7 @@ class Api {
}
getFullUrl(url) {
return (config.basic.apiUrl + '/' + url).replace(/([^:])\/+/g, '$1/');
return (config.apiUrl + '/' + url).replace(/([^:])\/+/g, '$1/');
}
}