NIFI-3130: - Loading the temporary instance from the correct type of component.

This closes #1285.

Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
Matt Gilman 2016-11-30 13:24:31 -05:00 committed by Bryan Bende
parent fff0148a0e
commit 1f40f298c0
No known key found for this signature in database
GPG Key ID: A0DDA9ED50711C39
2 changed files with 3 additions and 3 deletions

View File

@ -283,7 +283,7 @@ public class ControllerResource extends ApplicationResource {
lookup -> { lookup -> {
authorizeController(RequestAction.WRITE); authorizeController(RequestAction.WRITE);
final ConfigurableComponentAuthorizable authorizable = lookup.getProcessorByType(requestReportingTask.getType()); final ConfigurableComponentAuthorizable authorizable = lookup.getReportingTaskByType(requestReportingTask.getType());
if (authorizable.isRestricted()) { if (authorizable.isRestricted()) {
lookup.getRestrictedComponents().authorize(authorizer, RequestAction.WRITE, NiFiUserUtils.getNiFiUser()); lookup.getRestrictedComponents().authorize(authorizer, RequestAction.WRITE, NiFiUserUtils.getNiFiUser());
} }
@ -380,7 +380,7 @@ public class ControllerResource extends ApplicationResource {
lookup -> { lookup -> {
authorizeController(RequestAction.WRITE); authorizeController(RequestAction.WRITE);
final ConfigurableComponentAuthorizable authorizable = lookup.getProcessorByType(requestControllerService.getType()); final ConfigurableComponentAuthorizable authorizable = lookup.getControllerServiceByType(requestControllerService.getType());
if (authorizable.isRestricted()) { if (authorizable.isRestricted()) {
lookup.getRestrictedComponents().authorize(authorizer, RequestAction.WRITE, NiFiUserUtils.getNiFiUser()); lookup.getRestrictedComponents().authorize(authorizer, RequestAction.WRITE, NiFiUserUtils.getNiFiUser());
} }

View File

@ -2135,7 +2135,7 @@ public class ProcessGroupResource extends ApplicationResource {
final Authorizable processGroup = lookup.getProcessGroup(groupId).getAuthorizable(); final Authorizable processGroup = lookup.getProcessGroup(groupId).getAuthorizable();
processGroup.authorize(authorizer, RequestAction.WRITE, user); processGroup.authorize(authorizer, RequestAction.WRITE, user);
final ConfigurableComponentAuthorizable authorizable = lookup.getProcessorByType(requestControllerService.getType()); final ConfigurableComponentAuthorizable authorizable = lookup.getControllerServiceByType(requestControllerService.getType());
if (authorizable.isRestricted()) { if (authorizable.isRestricted()) {
lookup.getRestrictedComponents().authorize(authorizer, RequestAction.WRITE, user); lookup.getRestrictedComponents().authorize(authorizer, RequestAction.WRITE, user);
} }