Search in sources :

Example 1 with CatalogACLInputFilter

use of com.emc.sa.api.utils.CatalogACLInputFilter in project coprhd-controller by CoprHD.

the class CatalogCategoryService 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) {
    CatalogCategory catalogCategory = catalogCategoryManager.getCatalogCategoryById(id);
    URI tenantId = uri(catalogCategory.getTenant());
    _permissionsHelper.updateACLs(catalogCategory, changes, new CatalogACLInputFilter(tenantId));
    catalogCategoryManager.updateCatalogCategory(catalogCategory);
    ;
    auditOpSuccess(OperationTypeEnum.MODIFY_CATALOG_CATEGORY_ACL, catalogCategory.getId().toString(), catalogCategory.getLabel(), changes);
    catalogConfigUtils.notifyCatalogAclChange();
    return getRoleAssignmentsResponse(id);
}
Also used : CatalogCategoryMapper.createNewCatalogCategory(com.emc.sa.api.mapper.CatalogCategoryMapper.createNewCatalogCategory) CatalogCategory(com.emc.storageos.db.client.model.uimodels.CatalogCategory) NamedURI(com.emc.storageos.db.client.model.NamedURI) URI(java.net.URI) CatalogACLInputFilter(com.emc.sa.api.utils.CatalogACLInputFilter) Path(javax.ws.rs.Path) Consumes(javax.ws.rs.Consumes) PUT(javax.ws.rs.PUT) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Example 2 with CatalogACLInputFilter

use of com.emc.sa.api.utils.CatalogACLInputFilter 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);
}
Also used : CatalogService(com.emc.storageos.db.client.model.uimodels.CatalogService) CatalogCategory(com.emc.storageos.db.client.model.uimodels.CatalogCategory) URI(java.net.URI) CatalogACLInputFilter(com.emc.sa.api.utils.CatalogACLInputFilter) Path(javax.ws.rs.Path) Consumes(javax.ws.rs.Consumes) PUT(javax.ws.rs.PUT) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

CatalogACLInputFilter (com.emc.sa.api.utils.CatalogACLInputFilter)2 CatalogCategory (com.emc.storageos.db.client.model.uimodels.CatalogCategory)2 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)2 URI (java.net.URI)2 Consumes (javax.ws.rs.Consumes)2 PUT (javax.ws.rs.PUT)2 Path (javax.ws.rs.Path)2 CatalogCategoryMapper.createNewCatalogCategory (com.emc.sa.api.mapper.CatalogCategoryMapper.createNewCatalogCategory)1 NamedURI (com.emc.storageos.db.client.model.NamedURI)1 CatalogService (com.emc.storageos.db.client.model.uimodels.CatalogService)1