Repository: nifi Updated Branches: refs/heads/master 6c9291ad5 -> 5dd743947
NIFI-2768: - Ensuring we correctly enforce authorization when the destination of a connection changes. This includes source, destination, and parent process group. - Ensuring the UI reseting accordingly when a request fails. This closes #1014. Signed-off-by: Bryan Bende <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/5dd74394 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/5dd74394 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/5dd74394 Branch: refs/heads/master Commit: 5dd743947cfaf1b5d35f40952da65b5aadece951 Parents: 6c9291a Author: Matt Gilman <[email protected]> Authored: Tue Sep 13 11:22:03 2016 -0400 Committer: Bryan Bende <[email protected]> Committed: Tue Sep 13 11:41:51 2016 -0400 ---------------------------------------------------------------------- .../src/main/java/org/apache/nifi/web/api/ConnectionResource.java | 2 +- .../nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/5dd74394/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java index 11abf86..fb25211 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java @@ -223,7 +223,7 @@ public class ConnectionResource extends ApplicationResource { // if a destination has been specified and is different final Connectable currentDestination = connAuth.getDestination(); - if (requestConnection.getDestination() != null && currentDestination.getIdentifier().equals(requestConnection.getDestination().getId())) { + if (requestConnection.getDestination() != null && !currentDestination.getIdentifier().equals(requestConnection.getDestination().getId())) { // verify access of the new destination (current destination was already authorized as part of the connection check) final Authorizable newDestinationAuthorizable = lookup.getConnectable(requestConnection.getDestination().getId()); newDestinationAuthorizable.authorize(authorizer, RequestAction.WRITE, NiFiUserUtils.getNiFiUser()); http://git-wip-us.apache.org/repos/asf/nifi/blob/5dd74394/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js index 71c6a58..b94026c 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js @@ -1386,7 +1386,7 @@ nf.Connection = (function () { nf.CanvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationId); nf.CanvasUtils.reloadConnectionSourceAndDestination(response.sourceId, response.destinationId); }).fail(function (xhr, status, error) { - if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { + if (xhr.status === 400 || xhr.status === 401 || xhr.status === 403 || xhr.status === 404 || xhr.status === 409) { nf.Dialog.showOkDialog({ headerText: 'Connection', dialogContent: nf.Common.escapeHtml(xhr.responseText)
