mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add needsPermission protection to core nodes
This commit is contained in:
@@ -150,12 +150,9 @@ module.exports = function(RED) {
|
||||
}
|
||||
RED.nodes.registerType("arduino out",DuinoNodeOut);
|
||||
|
||||
RED.httpAdmin.get("/arduinoports",function(req,res) {
|
||||
RED.httpAdmin.get("/arduinoports", RED.auth.needsPermission("arduino.read"), function(req,res) {
|
||||
ArduinoFirmata.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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -274,11 +274,11 @@ module.exports = function(RED) {
|
||||
}
|
||||
RED.nodes.registerType("rpi-mouse",PiMouseNode);
|
||||
|
||||
RED.httpAdmin.get('/rpi-gpio/:id',function(req,res) {
|
||||
res.send( JSON.stringify(pitype) );
|
||||
RED.httpAdmin.get('/rpi-gpio/:id', RED.auth.needsPermission('rpi-gpio.read'), function(req,res) {
|
||||
res.json(pitype);
|
||||
});
|
||||
|
||||
RED.httpAdmin.get('/rpi-pins/:id',function(req,res) {
|
||||
res.send( JSON.stringify(pinsInUse) );
|
||||
RED.httpAdmin.get('/rpi-pins/:id', RED.auth.needsPermission('rpi-gpio.read'), function(req,res) {
|
||||
res.json(pinsInUse);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user