tmaret commented on a change in pull request #40:
URL:
https://github.com/apache/sling-org-apache-sling-distribution-core/pull/40#discussion_r414184650
##########
File path:
src/main/java/org/apache/sling/distribution/agent/impl/PrivilegeDistributionRequestAuthorizationStrategy.java
##########
@@ -68,8 +76,8 @@ public void checkPermission(@NotNull ResourceResolver
resourceResolver, @NotNull
private void checkPermissionForAdd(Session session, String[] paths)
throws RepositoryException, DistributionException {
AccessControlManager acMgr = session.getAccessControlManager();
-
- Privilege[] privileges = new
Privilege[]{acMgr.privilegeFromName(jcrPrivilege),
acMgr.privilegeFromName(Privilege.JCR_READ)};
+ additionalJcrPrivilegesForAdd = additionalJcrPrivilegesForAdd != null
? additionalJcrPrivilegesForAdd : new String[] {Privilege.JCR_READ};
Review comment:
Instead of the switch in the code, I suggest to leverage the default
value of the property.
```
@Property(value="jcr:read", ...)
private static final String JCR_ADD_PRIVILEGES =
"additionalJcrPrivilegesForAdd";
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]