Search in sources :

Example 1 with ComponentAuthorizable

use of org.apache.nifi.authorization.resource.ComponentAuthorizable in project nifi by apache.

the class DtoFactory method createComponentReferenceDto.

public ComponentReferenceDTO createComponentReferenceDto(final Authorizable authorizable) {
    if (authorizable == null || !(authorizable instanceof ComponentAuthorizable)) {
        return null;
    }
    final ComponentAuthorizable componentAuthorizable = (ComponentAuthorizable) authorizable;
    final ComponentReferenceDTO dto = new ComponentReferenceDTO();
    dto.setId(componentAuthorizable.getIdentifier());
    dto.setParentGroupId(componentAuthorizable.getProcessGroupIdentifier());
    dto.setName(authorizable.getResource().getName());
    return dto;
}
Also used : ComponentAuthorizable(org.apache.nifi.authorization.resource.ComponentAuthorizable)

Aggregations

ComponentAuthorizable (org.apache.nifi.authorization.resource.ComponentAuthorizable)1