use of com.emc.storageos.db.client.model.uimodels.CatalogService in project coprhd-controller by CoprHD.
the class CatalogServiceService method updateRoleAssignments.
@PUT
@Path("/{id}/acl")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SECURITY_ADMIN, Role.TENANT_ADMIN }, acls = { ACL.OWN }, blockProxies = true)
public ACLAssignments updateRoleAssignments(@PathParam("id") URI id, ACLAssignmentChanges changes) {
CatalogService catalogService = catalogServiceManager.getCatalogServiceById(id);
CatalogCategory parentCatalogCategory = catalogCategoryManager.getCatalogCategoryById(catalogService.getCatalogCategoryId().getURI());
URI tenantId = uri(parentCatalogCategory.getTenant());
_permissionsHelper.updateACLs(catalogService, changes, new CatalogACLInputFilter(tenantId));
catalogServiceManager.updateCatalogService(catalogService, null);
;
auditOpSuccess(OperationTypeEnum.MODIFY_CATALOG_SERVICE_ACL, catalogService.getId().toString(), catalogService.getLabel(), changes);
catalogConfigUtils.notifyCatalogAclChange();
return getRoleAssignmentsResponse(id);
}
use of com.emc.storageos.db.client.model.uimodels.CatalogService in project coprhd-controller by CoprHD.
the class CatalogServiceService method getCatalogService.
/**
* Get info for catalog category
*
* @param id the URN of a Catalog Category
* @prereq none
* @brief Show catalog category
* @return Catalog Category details
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}")
public CatalogServiceRestRep getCatalogService(@PathParam("id") URI id) {
CatalogService catalogService = queryResource(id);
ServiceDescriptor serviceDescriptor = getServiceDescriptor(catalogService);
List<CatalogServiceField> catalogServiceFields = catalogServiceManager.getCatalogServiceFields(catalogService.getId());
return map(catalogService, serviceDescriptor, catalogServiceFields);
}
use of com.emc.storageos.db.client.model.uimodels.CatalogService in project coprhd-controller by CoprHD.
the class CatalogServiceService method updateCatalogService.
/**
* Update catalog service
*
* @param param Catalog Service update parameters
* @param id the URN the catalog service
* @prereq none
* @brief Update Catalog Service
* @return No data returned in response body
*/
@PUT
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}")
@CheckPermission(roles = { Role.TENANT_ADMIN }, acls = { ACL.OWN })
public CatalogServiceRestRep updateCatalogService(@PathParam("id") URI id, CatalogServiceUpdateParam param) {
CatalogService catalogService = getCatalogServiceById(id, true);
List<CatalogServiceField> catalogServiceFields = catalogServiceManager.getCatalogServiceFields(id);
StorageOSUser user = getUserFromContext();
CatalogCategory parentCatalogCategory = catalogCategoryManager.getCatalogCategoryById(param.getCatalogCategory());
verifyAuthorizedInTenantOrg(uri(parentCatalogCategory.getTenant()), user);
validateParam(param, catalogService);
updateObject(catalogService, param, parentCatalogCategory);
List<CatalogServiceField> updatedCatalogServiceFields = updateObjectList(catalogService, catalogServiceFields, param.getCatalogServiceFields());
catalogServiceManager.updateCatalogService(catalogService, updatedCatalogServiceFields);
auditOpSuccess(OperationTypeEnum.UPDATE_CATALOG_SERVICE, catalogService.auditParameters());
// Refresh Objects
catalogService = catalogServiceManager.getCatalogServiceById(catalogService.getId());
catalogServiceFields = catalogServiceManager.getCatalogServiceFields(catalogService.getId());
ServiceDescriptor serviceDescriptor = getServiceDescriptor(catalogService);
return map(catalogService, serviceDescriptor, catalogServiceFields);
}
use of com.emc.storageos.db.client.model.uimodels.CatalogService in project coprhd-controller by CoprHD.
the class CatalogServiceService method getRoleAssignmentsResponse.
private ACLAssignments getRoleAssignmentsResponse(URI id) {
CatalogService catalogService = catalogServiceManager.getCatalogServiceById(id);
ACLAssignments response = new ACLAssignments();
response.setAssignments(_permissionsHelper.convertToACLEntries(catalogService.getAcls()));
return response;
}
use of com.emc.storageos.db.client.model.uimodels.CatalogService in project coprhd-controller by CoprHD.
the class CatalogServiceMapper method createNewObject.
public static CatalogService createNewObject(CatalogServiceCreateParam param, CatalogCategory catalogCategory) {
CatalogService newObject = new CatalogService();
newObject.setId(URIUtil.createId(CatalogService.class));
updateObject(newObject, param, catalogCategory);
return newObject;
}
Aggregations