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:
@@ -17,6 +17,7 @@
|
||||
var when = require("when");
|
||||
|
||||
var log = require("../log");
|
||||
var needsPermission = require("../api/auth").needsPermission;
|
||||
|
||||
var credentialCache = {};
|
||||
var storage = null;
|
||||
@@ -27,7 +28,7 @@ var redApp = null;
|
||||
* Adds an HTTP endpoint to allow look up of credentials for a given node id.
|
||||
*/
|
||||
function registerEndpoint(type) {
|
||||
redApp.get('/credentials/' + type + '/:id', function (req, res) {
|
||||
redApp.get('/credentials/' + type + '/:id', needsPermission(type+".read"), function (req, res) {
|
||||
// TODO: This could be a generic endpoint with the type value
|
||||
// parameterised.
|
||||
//
|
||||
|
Reference in New Issue
Block a user