ResourceTypePermissionValidator { public Optional<PermissionAction> resourceDependancy(ResourceType resourceType, ResourceAction permissionType) { return permissionMap.get(resourceType).stream().filter(vp -> vp.getResourceAction().equals(permissionType)).findFirst(); } ResourceTypePermissionValidator(); @Inject  ResourceTypePermissionValidator(@Customizable final AppFormerActivities appFormerActivities, final OrganizationalUnitService organizationalUnitService,
                                           final WorkspaceProjectService projectService, final PermissionManager permissionManager); Set<Map.Entry<ResourceType, List<PermissionAction>>> getPermissionEntries(); boolean isPermissionAllowed(ResourceType resourceType, ResourceAction permissionType); Optional<PermissionAction> resourceDependancy(ResourceType resourceType, ResourceAction permissionType); boolean satisfyDependancies(PermissionCollection pc, ResourceType resourceType, ResourceAction resourceAction); boolean isValidResourceType(ResourceType resourceType, String resourceId);  }
@Test public void testResourceDependancy() { assertEquals( permissionValidator.resourceDependancy(OrganizationalUnit.RESOURCE_TYPE, UPDATE).get().getDependantAction(), READ); assertNull(permissionValidator.resourceDependancy(ActivityResourceType.PERSPECTIVE, READ).get().getDependantAction()); assertEquals( permissionValidator.resourceDependancy(Repository.RESOURCE_TYPE, UPDATE).get().getDependantAction(), READ); assertFalse(permissionValidator.resourceDependancy(ActivityResourceType.EDITOR, UPDATE).isPresent()); }