Github user mcgilman commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2899#discussion_r202814854
--- Diff:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
---
@@ -167,12 +167,14 @@
nfNgBridge.injector.get('breadcrumbsCtrl').resetScrollPosition();
// set page title to the name of the root processor group
- var rootBreadcrumb = breadcrumb;
- while(rootBreadcrumb.parentBreadcrumb != null) {
- rootBreadcrumb = rootBreadcrumb.parentBreadcrumb
- }
+ if (breadcrumb.permissions.canRead) {
+ var rootBreadcrumb = breadcrumb;
+ while(rootBreadcrumb.parentBreadcrumb != null) {
+ rootBreadcrumb = rootBreadcrumb.parentBreadcrumb
+ }
- document.title = rootBreadcrumb.breadcrumb.name;
+ document.title = rootBreadcrumb.breadcrumb.name;
--- End diff --
@patricker Thanks for the PR!
I haven't run this yet, but I think there may still be an issue. We need to
ensure we have permissions to the `rootBreadcrumb` here. If the user navigated
to a sub-Process Group but did not have permissions to the root Process Group I
think we'd still have the error.
Additionally, if the user navigated to a sub-Process Group which they
didn't have access to but they did have access to the root Process Group we
would unnecessarily avoid setting the document title.
I don't believe there was an issue with identifying the `rootBreadcrumb`.
The issue was attempting to extract the breadcrumb's name through the
`breadcrumb` field which is `null`ed out when a user doesn't have permissions
to the corresponding Process Group.
---