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

 ##########
 File path: 
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/EntityResource.java
 ##########
 @@ -221,6 +221,11 @@ public int compare(Task<?> o1, Task<?> o2) {
     @Override
     public TaskSummary getTask(final String application, final String 
entityToken, String taskId) {
         // TODO deprecate in favour of ActivityApi.get ?
+        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'",
 
 Review comment:
   Message should say `User '%s' is not authorized to see the task '%s' for the 
entity '%s'`
   Please also check the parameters for the templated message

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to