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

 ##########
 File path: 
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/PolicyResource.java
 ##########
 @@ -120,6 +132,11 @@ public Response start( String application, String 
entityToken, String policyId)
     public Response stop(String application, String entityToken, String 
policyId) {
         Policy policy = brooklyn().getPolicy(application, entityToken, 
policyId);
 
+        if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), 
Entitlements.STOP_POLICY, policy)) {
+            throw WebResourceUtils.forbidden("User '%s' is not authorized to 
remove policies",
 
 Review comment:
   Message should say `User '%s' is not authorized to stop the policy '%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