tbouron commented on a change in pull request #1061: Granularity entitlement
control
URL: https://github.com/apache/brooklyn-server/pull/1061#discussion_r270408234
##########
File path:
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/BundleResource.java
##########
@@ -153,6 +154,10 @@ public TypeDetail getTypeExplicitVersion(String
symbolicName, String version, St
@Override
public BundleInstallationRestResult remove(String symbolicName, String
version, Boolean force) {
ManagedBundle b = lookup(symbolicName, version);
+ if (!Entitlements.isEntitled(mgmt().getEntitlementManager(),
Entitlements.MODIFY_CATALOG_ITEM,
Entitlements.StringAndArgument.of(symbolicName+(Strings.isBlank(version) ? "" :
":"+version), "delete"))) {
+ throw WebResourceUtils.forbidden("User '%s' is not authorized to
remove catalog items",
Review comment:
Message should say `User '%s' is not authorized to remove catalog item
'%s:%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