class ResourceTypePermissionValidator {

    public boolean isValidResourceType(ResourceType resourceType, String resourceId) {
        if (resourceType.equals(ActivityResourceType.PERSPECTIVE) &&
                appFormerActivities.getAllPerpectivesIds().contains(resourceId)) {
            return true;
        } else if (resourceType.equals(ActivityResourceType.EDITOR) &&
                appFormerActivities.getAllEditorIds().contains(resourceId)) {
            return true;
        } else if (resourceType.equals(OrganizationalUnit.RESOURCE_TYPE)) {
            return organizationalUnitService.getOrganizationalUnits().stream()
                    .anyMatch(orgUnit -> resourceId.equals(orgUnit.getName()));
        } else if (resourceType.equals(Repository.RESOURCE_TYPE)) {
            return projectService.getAllWorkspaceProjects().stream()
                    .anyMatch(project -> resourceId.equals(project.getName()));
        }
        return false;
    }

    public  ResourceTypePermissionValidator();
    @Inject public  ResourceTypePermissionValidator(@Customizable final AppFormerActivities appFormerActivities, final OrganizationalUnitService organizationalUnitService,
                                           final WorkspaceProjectService projectService, final PermissionManager permissionManager);

}