Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/540#discussion_r25776818
  
    --- Diff: 
usage/rest-server/src/main/java/brooklyn/rest/resources/CatalogResource.java ---
    @@ -311,6 +317,18 @@ public Response getIcon(String itemId, String version) 
{
             return getCatalogItemIcon(result);
         }
     
    +    @Override
    +    public void setDeprecated(String itemId, boolean deprecated) {
    +        if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), 
Entitlements.MODIFY_CATALOG_ITEM, StringAndArgument.of(itemId, "deprecated"))) {
    +            throw WebResourceUtils.unauthorized("User '%s' is not 
authorized to modify catalog",
    +                    Entitlements.getEntitlementContext().user());
    +        }
    +        CatalogItem<?, ?> item = 
CatalogUtils.getCatalogItemOptionalVersion(mgmt(), itemId);
    +        if (item==null)
    +            throw WebResourceUtils.notFound("Catalog item with id '%s' not 
found", itemId);
    +        item.setDeprecated(deprecated);
    --- End diff --
    
    This won't be persisted - if you stopped and restarted Brooklyn then the 
catalog item would no longer be deprecated (I think).
    
    See things like `RebindCatalogItemTest` for where we're testing catalog 
persistence.
    
    We're going to have to call something on ` mgmt.getCatalog()....` to tell 
it to persist this change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to