diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js index c4050d63f7..b09bf57ca1 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/propertytable/jquery.propertytable.js @@ -1363,14 +1363,16 @@ } if (options.readOnly !== true) { - var canModifyParamContexts = nfCommon.canModifyParameterContexts(); - var paramContextIsSet = false; - if (_.isFunction(options.getParameterContextId)) { - paramContextIsSet = !_.isNil(options.getParameterContextId(groupId)); + var canConvertPropertyToParam = false; + if (_.isFunction(options.getParameterContext)) { + var paramContext = options.getParameterContext(groupId); + var canWriteParamContext = _.get(paramContext, 'permissions.canWrite', false); + var canReadParamContext = _.get(paramContext, 'permissions.canRead', false); + canConvertPropertyToParam = canWriteParamContext && canReadParamContext; } var referencesParam = referencesParameter(dataContext.value); - if (canModifyParamContexts && paramContextIsSet && !referencesParam && !identifiesControllerService) { + if (canConvertPropertyToParam && !referencesParam && !identifiesControllerService) { markup += '
'; } @@ -1571,16 +1573,20 @@ } } } else if (target.hasClass('convert-to-parameter')) { - var parameterContextId; - if (_.isFunction(options.getParameterContextId)) { - parameterContextId = options.getParameterContextId(groupId); + var parameterContext; + var canConvertPropertyToParam = false; + if (_.isFunction(options.getParameterContext)) { + parameterContext = options.getParameterContext(groupId); + var canWriteParamContext = _.get(parameterContext, 'permissions.canWrite', false); + var canReadParamContext = _.get(parameterContext, 'permissions.canRead', false); + canConvertPropertyToParam = canWriteParamContext && canReadParamContext; } - if (options.readOnly !== true && !_.isNil(parameterContextId)) { + if (options.readOnly !== true && canConvertPropertyToParam) { var descriptors = table.data('descriptors'); var propertyDescriptor = descriptors[property.property]; - nfParameterContexts.convertPropertyToParameter(property, propertyDescriptor, parameterContextId) + nfParameterContexts.convertPropertyToParameter(property, propertyDescriptor, parameterContext.id) .done(function (parameter) { var updatedItem = _.extend({}, property, { previousValue: property.value, diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js index 84c1175269..14a92802c1 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js @@ -1876,10 +1876,14 @@ goToServiceDeferred: function () { return goToServiceFromProperty(serviceTable); }, - getParameterContextId: function (groupId) { + getParameterContext: function (groupId) { + if (_.isNil(controllerServiceEntity.parentGroupId)) { + return null; + } + var parameterContext; - // attempt to identify the parameter context id, conditional based on whether + // attempt to identify the parameter context, conditional based on whether // the user is configuring the current process group if (_.isNil(groupId) || groupId === nfCanvasUtils.getGroupId()) { parameterContext = nfCanvasUtils.getParameterContext(); @@ -1888,7 +1892,7 @@ parameterContext = parentProcessGroup.parameterContext; } - return nfCommon.isDefinedAndNotNull(parameterContext) ? parameterContext.id : null; + return parameterContext; } }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js index dfb3c398e6..4437b4ff6b 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js @@ -660,10 +660,9 @@ }).promise(); }, goToServiceDeferred: goToServiceFromProperty, - getParameterContextId: function (groupId) { + getParameterContext: function (groupId) { // processors being configured must be in the current group - var parameterContext = nfCanvasUtils.getParameterContext(); - return nfCommon.isDefinedAndNotNull(parameterContext) ? parameterContext.id : null; + return nfCanvasUtils.getParameterContext(); } }); },