Search in sources :

Example 1 with PipelinesWithPermissionsVO

use of com.epam.pipeline.controller.vo.PipelinesWithPermissionsVO in project cloud-pipeline by epam.

the class GrantPermissionManager method loadAllPipelinesWithPermissions.

public PipelinesWithPermissionsVO loadAllPipelinesWithPermissions(Integer pageNum, Integer pageSize) {
    // TODO: fully switch to common method loadAllEntitiesPermissions when client is ready
    EntityWithPermissionVO entityWithPermissionVO = loadAllEntitiesPermissions(AclClass.PIPELINE, pageNum, pageSize, false, null);
    PipelinesWithPermissionsVO result = new PipelinesWithPermissionsVO();
    result.setTotalCount(entityWithPermissionVO.getTotalCount());
    result.setPipelines(entityWithPermissionVO.getEntityPermissions().stream().map(e -> {
        PipelineWithPermissions pipelineWithPermissions = pipelineWithPermissionsMapper.toPipelineWithPermissions((Pipeline) e.getEntity());
        pipelineWithPermissions.setPermissions(e.getPermissions());
        return pipelineWithPermissions;
    }).collect(toSet()));
    return result;
}
Also used : PipelinesWithPermissionsVO(com.epam.pipeline.controller.vo.PipelinesWithPermissionsVO) PipelineWithPermissions(com.epam.pipeline.entity.pipeline.PipelineWithPermissions) EntityWithPermissionVO(com.epam.pipeline.controller.vo.security.EntityWithPermissionVO)

Aggregations

PipelinesWithPermissionsVO (com.epam.pipeline.controller.vo.PipelinesWithPermissionsVO)1 EntityWithPermissionVO (com.epam.pipeline.controller.vo.security.EntityWithPermissionVO)1 PipelineWithPermissions (com.epam.pipeline.entity.pipeline.PipelineWithPermissions)1