Fix missing httpAdmin permissions for Pushbullet, twitter what3words and sensehatsim

fixes #244
This commit is contained in:
Dave Conway-Jones
2016-11-06 20:27:21 +00:00
parent a7247e898a
commit 7917ca8dcf
4 changed files with 13 additions and 73 deletions

View File

@@ -1,18 +1,3 @@
/**
* Copyright 2013,2016 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
module.exports = function(RED) {
"use strict";
@@ -472,7 +457,7 @@ module.exports = function(RED) {
}
};
RED.httpAdmin.get('/pushbullet/:id/migrate', function(req, res) {
RED.httpAdmin.get('/pushbullet/:id/migrate', RED.auth.needsPermission('pushbullet.read'), function(req, res) {
var node = RED.nodes.getNode(req.params.id);
if (node && node.migrated) {
if (req.query.save) {
@@ -493,7 +478,7 @@ module.exports = function(RED) {
}
});
RED.httpAdmin.get('/pushbullet/:id/devices', function(req, res) {
RED.httpAdmin.get('/pushbullet/:id/devices', RED.auth.needsPermission('pushbullet.read'), function(req, res) {
var config = RED.nodes.getNode(req.params.id);
var cred = RED.nodes.getCredentials(req.params.id);
var pb;