Add needsPermission protection to core nodes

This commit is contained in:
Nick O'Leary
2015-02-06 13:57:15 +00:00
parent d1fe997bf7
commit c7f13e3d0c
6 changed files with 25 additions and 27 deletions

View File

@@ -299,12 +299,9 @@ module.exports = function(RED) {
}
}();
RED.httpAdmin.get("/serialports",function(req,res) {
RED.httpAdmin.get("/serialports", RED.auth.needsPermission('serial.read'), function(req,res) {
serialp.list(function (err, ports) {
//console.log(JSON.stringify(ports));
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write(JSON.stringify(ports));
res.end();
res.json(ports);
});
});
}