tbouron commented on a change in pull request #1061: Granularity entitlement 
control
URL: https://github.com/apache/brooklyn-server/pull/1061#discussion_r274305765
 
 

 ##########
 File path: 
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ApplicationResource.java
 ##########
 @@ -620,11 +620,21 @@ private void checkLocationsAreValid(ApplicationSpec 
applicationSpec) {
 
     @Override
     public List<EntitySummary> getDescendants(String application, String 
typeRegex) {
+        Entity entity =brooklyn().getApplication(application);
+        if (entity != null && 
!Entitlements.isEntitled(mgmt().getEntitlementManager(), 
Entitlements.SEE_ENTITY, entity)) {
+            throw WebResourceUtils.forbidden("User '%s' is not authorized to 
see the entity '%s'",
+                    Entitlements.getEntitlementContext().user(), entity);
 
 Review comment:
   I think you missed this one

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to