tbouron commented on a change in pull request #1061: Granularity entitlement
control
URL: https://github.com/apache/brooklyn-server/pull/1061#discussion_r274306273
##########
File path:
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/LocationResource.java
##########
@@ -166,6 +185,11 @@ public Response create(LocationSpec locationSpec) {
@Override
@Deprecated
public void delete(String locationId) {
+ if (!Entitlements.isEntitled(mgmt().getEntitlementManager(),
Entitlements.DELETE_LOCATION, Entitlements.StringAndArgument.of(locationId,
"delete"))) {
+ throw WebResourceUtils.forbidden("User '%s' is not authorized to
delete locations",
Review comment:
The message should say `User '%s' is not authorized to delete the location
'%s'`
----------------------------------------------------------------
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