[GitHub] nifi issue #2990: NIFI-375: Added operation policy
Github user mcgilman commented on the issue: https://github.com/apache/nifi/pull/2990 @ijokarumawak Thanks this looks good. I'm going to squash and merged to master. I've created two new JIRAs that are related to this effort but separate from the initial concern. Thanks again for working through all the review comments! https://issues.apache.org/jira/browse/NIFI-5610 https://issues.apache.org/jira/browse/NIFI-5611 ---
[GitHub] nifi issue #2990: NIFI-375: Added operation policy
Github user ijokarumawak commented on the issue: https://github.com/apache/nifi/pull/2990 @mcgilman Incorporated the last review comments. The original intent of having `operatePermissions` at each concrete entity implementation is to clarify which entity is `OperationPermissible`. I thought adding that to ComponentEntity is to vague as ComponentEntity is the super class of various entities, including those do not have running status such as `AccessPolicySummaryEntity`, `TemplateEntity` or `UserGroupEntity`. I wasn't consistent enough while I was refactoring the code at some point and added it to ComponentEntity. But I still think the operatePermissions should exist with only component those can be operated. So, I removed operatePermissions from ComponentEntity. I hope this we have polished this PR enough to get merged. Thanks for your comprehensive review comments! ---
[GitHub] nifi issue #2990: NIFI-375: Added operation policy
Github user mcgilman commented on the issue: https://github.com/apache/nifi/pull/2990 @ijokarumawak This is looking really good! Just seeing a couple minor things aside from the NPE I commented in the code. It looks like the `operatePermissions` were added to the `ComponentEntity`. This is good since this applied to the majority of components. However, I noticed that the `operatePermissions` was also added to the each of the concrete implementations (`ProcessorEntity`, `PortEntity`, etc). I do not believe we need the field and getter/setter methods within each concrete implementation. Is there a reason they are there? Also, I think we need to apply the new `Operation` policy checks in `FlowResource#activeControllerServices`. This is essentially like the corresponding `FlowResource#scheduleComponents` but for `ControllerServices`. This endpoint is not called directly by the NiFi UI but I think it should probably utilize the new policy. Thanks again! ---
[GitHub] nifi issue #2990: NIFI-375: Added operation policy
Github user mcgilman commented on the issue: https://github.com/apache/nifi/pull/2990 @ijokarumawak I see. You're correct that the existing codebase also exhibits this behavior. However, I think that its an issue we should consider fixing separately from this. Generally speaking, I think the UI should not allow the user to change something that they cannot change back (assuming the same permissions). Let's proceed here and we can address this concern in a future effort. Thanks... I'll continue reviewing! ---
[GitHub] nifi issue #2990: NIFI-375: Added operation policy
Github user ijokarumawak commented on the issue: https://github.com/apache/nifi/pull/2990 @mcgilman Rebased with the latest master and incorporated the feedback. About the concern: > The issue that we're hitting now is that a user with permissions outlined above with Service Only will be able to Enable this service but will be unable to subsequently disable it. I added another commit to address this, but I'm going to remove that commit. Because... I confirmed that even before this PR, NiFi UI works like this if the user has READ/WRITE permissions for a CS, but only has READ to its referencing components. Such user can enable the CS if 'Service Only', but can not disable the CS because the referencing component can not be written. ---
[GitHub] nifi issue #2990: NIFI-375: Added operation policy
Github user mcgilman commented on the issue: https://github.com/apache/nifi/pull/2990 @ijokarumawak Thanks for the update. I'm still in the process of reviewing but one thing that concerns me is where we've identified Service Only in the scenarios above. Currently (before the PR) the Enable case we allow the user to specify if they want to enable just this service or this service and all components that reference it (including other services and their referencing components). During the Disable case, we require that the user disables this service and all referencing components. This is because the referencing components require this service's availability to continue running. The issue that we're hitting now is that a user with permissions outlined above with Service Only will be able to Enable this service but will be unable to subsequently disable it. Because of this, I'm wondering if we need to be even more strict to prevent this cases via the UI. I don't think its too restrictive as this is more of a corner case. The more common use case here will be granting operators permissions to the read policies and operation policies for these components. Thoughts? ---
[GitHub] nifi issue #2990: NIFI-375: Added operation policy
Github user mcgilman commented on the issue: https://github.com/apache/nifi/pull/2990 @ijokarumawak Thanks for the additional commits! Will review... ---
[GitHub] nifi issue #2990: NIFI-375: Added operation policy
Github user ijokarumawak commented on the issue: https://github.com/apache/nifi/pull/2990 @mcgilman I hope this PR is now fully ready for review. Thanks. ---
[GitHub] nifi issue #2990: NIFI-375: Added operation policy
Github user ijokarumawak commented on the issue: https://github.com/apache/nifi/pull/2990 @mcgilman Updated how API exposes required data to operate components. Although I need to do the similar refactoring with RGPs, the most complex ControllerService implementation is done. I updated the PR description, too, to illustrate how ControllerService enable/disable operations are authorized. It'd be great if you can review this while I'm working on the remaining RPG stuffs. Thanks! ---
[GitHub] nifi issue #2990: NIFI-375: Added operation policy
Github user mcgilman commented on the issue: https://github.com/apache/nifi/pull/2990 Will review... ---