brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Allows catalog items to be deprec...
Date Wed, 04 Mar 2015 21:20:54 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/540#discussion_r25815022
  
    --- 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 --
    
    You presumably need to call `catalog.persist(item)` after doing the `item.setDeprecated`?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message