Add a userid_to_dbuser function
This commit is contained in:
parent
d399d2153f
commit
8574517ab8
@ -53,6 +53,15 @@ function queryMayWrite(sql) {
|
|||||||
return mayWrite;
|
return mayWrite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database username from user_id
|
||||||
|
// NOTE: a "null" user_id is a request to use the public user
|
||||||
|
function userid_to_dbuser(user_id) {
|
||||||
|
if ( _.isString(user_id) )
|
||||||
|
return _.template(global.settings.db_user, {user_id: user_id});
|
||||||
|
return "publicuser" // FIXME: make configurable
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// request handlers
|
// request handlers
|
||||||
function handleQuery(req, res) {
|
function handleQuery(req, res) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user