mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Auth permission should honour the token scope
This commit is contained in:
@@ -71,8 +71,8 @@ function start() {
|
||||
handleRemoteSubscription(ws,msg.subscribe);
|
||||
}
|
||||
} else {
|
||||
var completeConnection = function(user,sendAck) {
|
||||
if (!user || !Permissions.hasPermission(user,"status.read")) {
|
||||
var completeConnection = function(userScope,sendAck) {
|
||||
if (!userScope || !Permissions.hasPermission(userScope,"status.read")) {
|
||||
ws.close();
|
||||
} else {
|
||||
pendingAuth = false;
|
||||
@@ -87,7 +87,7 @@ function start() {
|
||||
Tokens.get(msg.auth).then(function(client) {
|
||||
if (client) {
|
||||
Users.get(client.user).then(function(user) {
|
||||
completeConnection(user,true);
|
||||
completeConnection(client.scope,true);
|
||||
});
|
||||
} else {
|
||||
completeConnection(null,false);
|
||||
|
Reference in New Issue
Block a user