@Override public AuthorizationResult checkAuthorization(NiFiUser user) { // perform the authorization of the user by using the underlying component, ensures consistent authorization with raw s2s final PortAuthorizationResult authorizationResult = ((RootGroupPort) outputPort).checkUserAuthorization(user); if (authorizationResult.isAuthorized()) { return AuthorizationResult.approved(); } else { return AuthorizationResult.denied(authorizationResult.getExplanation()); } } };
@Override public AuthorizationResult checkAuthorization(NiFiUser user) { // perform the authorization of the user by using the underlying component, ensures consistent authorization with raw s2s final PortAuthorizationResult authorizationResult = ((RootGroupPort) inputPort).checkUserAuthorization(user); if (authorizationResult.isAuthorized()) { return AuthorizationResult.approved(); } else { return AuthorizationResult.denied(authorizationResult.getExplanation()); } } };
if (!portAuthResult.isAuthorized()) { logger.debug("Responding with ResponseCode UNAUTHORIZED: ", portAuthResult.getExplanation()); throw new HandshakeException(ResponseCode.UNAUTHORIZED, portAuthResult.getExplanation());
if (!authorizationResult.isAuthorized()) { final String message = String.format("%s Cannot service request from %s (DN=%s) because peer is not authorized to communicate with this port: %s", this, flowFileRequest.getPeer(), flowFileRequest.getPeer().getCommunicationsSession().getUserDn(), authorizationResult.getExplanation()); logger.error(message); eventReporter.reportEvent(Severity.ERROR, CATEGORY, message); responseQueue.add(new ProcessingResult(new NotAuthorizedException(authorizationResult.getExplanation()))); return;
if (!portAuthResult.isAuthorized()) { logger.debug("Responding with ResponseCode UNAUTHORIZED: ", portAuthResult.getExplanation()); throw new HandshakeException(ResponseCode.UNAUTHORIZED, portAuthResult.getExplanation());
if (!authorizationResult.isAuthorized()) { final String message = String.format("%s Cannot service request from %s (DN=%s) because peer is not authorized to communicate with this port: %s", this, flowFileRequest.getPeer(), flowFileRequest.getPeer().getCommunicationsSession().getUserDn(), authorizationResult.getExplanation()); logger.error(message); eventReporter.reportEvent(Severity.ERROR, CATEGORY, message); responseQueue.add(new ProcessingResult(new NotAuthorizedException(authorizationResult.getExplanation()))); return;