[
https://issues.apache.org/jira/browse/NIFI-1952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15329488#comment-15329488
]
ASF GitHub Bot commented on NIFI-1952:
--------------------------------------
Github user jtstorck commented on a diff in the pull request:
https://github.com/apache/nifi/pull/526#discussion_r66968299
--- Diff:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
---
@@ -114,7 +123,23 @@
<property name="keyService" ref="keyService"/>
<property name="dtoFactory" ref="dtoFactory"/>
</bean>
+ <bean id="authorizableLookup"
class="org.apache.nifi.web.StandardAuthorizableLookup">
+ <property name="controllerFacade" ref="controllerFacade"/>
+ <property name="processorDAO" ref="processorDAO"/>
+ <property name="inputPortDAO" ref="inputPortDAO"/>
+ <property name="outputPortDAO" ref="outputPortDAO"/>
+ <property name="processGroupDAO" ref="processGroupDAO"/>
+ <property name="remoteProcessGroupDAO"
ref="remoteProcessGroupDAO"/>
+ <property name="labelDAO" ref="labelDAO"/>
+ <property name="funnelDAO" ref="funnelDAO"/>
+ <property name="connectionDAO" ref="connectionDAO"/>
+ <property name="controllerServiceDAO" ref="controllerServiceDAO"/>
+ <property name="reportingTaskDAO" ref="reportingTaskDAO"/>
+ <property name="templateDAO" ref="templateDAO"/>
+ <property name="snippetDAO" ref="snippetDAO"/>
+ </bean>
<bean id="serviceFacade"
class="org.apache.nifi.web.StandardNiFiServiceFacade">
+ <constructor-arg ref="authorizableLookup" />
--- End diff --
I prefer constructor injection over setter injection. I think it's best
that once an object is constructed, it should be usable, and that's not
possible with setter injection. With setters needing to be used to configure
the object, there's no way to indicate required versus optional properties,
outside of documentation. By using constructors, you can programmatically
declare the required properties. This has an added benefit (in my opinion) of
working towards making these types of objects (resources, services) immutable,
and I think, generally speaking, immutability moves towards easier testing.
> Create REST endpoints for user/group/policy management
> ------------------------------------------------------
>
> Key: NIFI-1952
> URL: https://issues.apache.org/jira/browse/NIFI-1952
> Project: Apache NiFi
> Issue Type: Sub-task
> Components: Core Framework
> Affects Versions: 1.0.0
> Reporter: Jeff Storck
> Assignee: Jeff Storck
> Fix For: 1.0.0
>
>
> REST endpoints are needed to provide CRUD capability for mutable authorizers
> (extensions of AbstractPolicyBasedAuthorizer) to manage users, groups, and
> policies.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)