diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRemoteGroupPort.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRemoteGroupPort.java index b1a1c92573..d8c055b889 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRemoteGroupPort.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRemoteGroupPort.java @@ -31,7 +31,10 @@ import java.util.concurrent.atomic.AtomicReference; import javax.net.ssl.SSLContext; +import org.apache.nifi.authorization.Resource; import org.apache.nifi.authorization.resource.Authorizable; +import org.apache.nifi.authorization.resource.ResourceFactory; +import org.apache.nifi.authorization.resource.ResourceType; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.connectable.ConnectableType; import org.apache.nifi.connectable.Connection; @@ -122,6 +125,12 @@ public class StandardRemoteGroupPort extends RemoteGroupPort { return getConnectableType() == ConnectableType.REMOTE_OUTPUT_PORT; } + @Override + public Resource getResource() { + final ResourceType resourceType = ConnectableType.REMOTE_INPUT_PORT.equals(getConnectableType()) ? ResourceType.InputPort : ResourceType.OutputPort; + return ResourceFactory.getComponentResource(resourceType, getIdentifier(), getName()); + } + @Override public Authorizable getParentAuthorizable() { return getRemoteProcessGroup(); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectionDAO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectionDAO.java index 4f3d944284..55c872fd35 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectionDAO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectionDAO.java @@ -300,9 +300,6 @@ public class StandardConnectionDAO extends ComponentDAO implements ConnectionDAO source = sourceGroup.getConnectable(sourceConnectableDTO.getId()); } - // ensure the user has write access to the source component - source.authorize(authorizer, RequestAction.WRITE, NiFiUserUtils.getNiFiUser()); - // find the destination final Connectable destination; if (ConnectableType.REMOTE_INPUT_PORT.name().equals(destinationConnectableDTO.getType())) { @@ -326,9 +323,6 @@ public class StandardConnectionDAO extends ComponentDAO implements ConnectionDAO destination = destinationGroup.getConnectable(destinationConnectableDTO.getId()); } - // ensure the user has write access to the source component - destination.authorize(authorizer, RequestAction.WRITE, NiFiUserUtils.getNiFiUser()); - // determine the relationships final Set relationships = new HashSet<>(); if (isNotNull(connectionDTO.getSelectedRelationships())) {