private boolean isTemplateVisibleAccordingToApplication(
     PublicationTemplate template, GlobalContext context, OrganisationController oc) {
   List<String> restrictedApplications = template.getApplications();
   String componentName = context.getComponentName();
   if (StringUtil.isDefined(context.getComponentId())) {
     ComponentInstLight component = oc.getComponentInstLight(context.getComponentId());
     componentName = component.getName();
   }
   return restrictedApplications.contains(componentName);
 }
 private boolean isTemplateVisibleAccordingToInstance(
     PublicationTemplate template, GlobalContext context) {
   List<String> restrictedInstanceIds = template.getInstances();
   return restrictedInstanceIds.contains(context.getComponentId());
 }