コード例 #1
0
 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);
 }
コード例 #2
0
 private boolean isTemplateVisibleAccordingToSpace(
     PublicationTemplate template, GlobalContext context, OrganisationController oc) {
   List<String> restrictedSpaceIds = template.getSpaces();
   List<SpaceInst> spacePath = oc.getSpacePath(context.getSpaceId());
   for (SpaceInst space : spacePath) {
     String spaceId = space.getId();
     if (!spaceId.startsWith(Admin.SPACE_KEY_PREFIX)) {
       spaceId = Admin.SPACE_KEY_PREFIX + spaceId;
     }
     if (restrictedSpaceIds.contains(spaceId)) {
       return true;
     }
   }
   return false;
 }
コード例 #3
0
 private boolean isTemplateVisibleAccordingToInstance(
     PublicationTemplate template, GlobalContext context) {
   List<String> restrictedInstanceIds = template.getInstances();
   return restrictedInstanceIds.contains(context.getComponentId());
 }