tbouron commented on a change in pull request #1061: Granularity entitlement
control
URL: https://github.com/apache/brooklyn-server/pull/1061#discussion_r270409445
##########
File path:
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/PolicyConfigResource.java
##########
@@ -74,6 +81,11 @@
@Override
public String get(String application, String entityToken, String
policyToken, String configKeyName) {
+ Entity entity = brooklyn().getEntity(application, entityToken);
+ 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 configuration
'%s' for 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